mirror of
https://github.com/tendermint/tendermint.git
synced 2026-08-01 12:56:08 +00:00
chore: Format and fix lints (#9336)
* make format Signed-off-by: Thane Thomson <connect@thanethomson.com> * Fix linting directives Signed-off-by: Thane Thomson <connect@thanethomson.com> * make mockery Signed-off-by: Thane Thomson <connect@thanethomson.com> * Appease CI linter Signed-off-by: Thane Thomson <connect@thanethomson.com> * Appease CI linter Signed-off-by: Thane Thomson <connect@thanethomson.com> Signed-off-by: Thane Thomson <connect@thanethomson.com>
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
// nolint: gosec
|
||||
package addr
|
||||
|
||||
import (
|
||||
@@ -25,7 +24,7 @@ func Fuzz(data []byte) int {
|
||||
}
|
||||
|
||||
// Also, make sure PickAddress always returns a non-nil address.
|
||||
bias := rand.Intn(100)
|
||||
bias := rand.Intn(100) //nolint:gosec
|
||||
if p := addrBook.PickAddress(bias); p == nil {
|
||||
panic(fmt.Sprintf("picked a nil address (bias: %d, addrBook size: %v)",
|
||||
bias, addrBook.Size()))
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// nolint: gosec
|
||||
package main
|
||||
|
||||
import (
|
||||
@@ -26,7 +25,7 @@ func initCorpus(baseDir string) {
|
||||
|
||||
// create "corpus" directory
|
||||
corpusDir := filepath.Join(baseDir, "corpus")
|
||||
if err := os.MkdirAll(corpusDir, 0755); err != nil {
|
||||
if err := os.MkdirAll(corpusDir, 0o755); err != nil {
|
||||
log.Fatalf("Creating %q err: %v", corpusDir, err)
|
||||
}
|
||||
|
||||
@@ -48,7 +47,8 @@ func initCorpus(baseDir string) {
|
||||
log.Fatalf("can't marshal %v: %v", addr, err)
|
||||
}
|
||||
|
||||
if err := os.WriteFile(filename, bz, 0644); err != nil {
|
||||
//nolint:gosec
|
||||
if err := os.WriteFile(filename, bz, 0o644); err != nil {
|
||||
log.Fatalf("can't write %v to %q: %v", addr, filename, err)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// nolint: gosec
|
||||
package main
|
||||
|
||||
import (
|
||||
@@ -21,11 +20,12 @@ func main() {
|
||||
initCorpus(*baseDir)
|
||||
}
|
||||
|
||||
//nolint:gosec
|
||||
func initCorpus(rootDir string) {
|
||||
log.SetFlags(0)
|
||||
|
||||
corpusDir := filepath.Join(rootDir, "corpus")
|
||||
if err := os.MkdirAll(corpusDir, 0755); err != nil {
|
||||
if err := os.MkdirAll(corpusDir, 0o755); err != nil {
|
||||
log.Fatalf("Creating %q err: %v", corpusDir, err)
|
||||
}
|
||||
sizes := []int{0, 1, 2, 17, 5, 31}
|
||||
@@ -72,7 +72,7 @@ func initCorpus(rootDir string) {
|
||||
|
||||
filename := filepath.Join(rootDir, "corpus", fmt.Sprintf("%d", n))
|
||||
|
||||
if err := os.WriteFile(filename, bz, 0644); err != nil {
|
||||
if err := os.WriteFile(filename, bz, 0o644); err != nil {
|
||||
log.Fatalf("can't write %X to %q: %v", bz, filename, err)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// nolint: gosec
|
||||
package main
|
||||
|
||||
import (
|
||||
@@ -20,7 +19,7 @@ func initCorpus(baseDir string) {
|
||||
log.SetFlags(0)
|
||||
|
||||
corpusDir := filepath.Join(baseDir, "corpus")
|
||||
if err := os.MkdirAll(corpusDir, 0755); err != nil {
|
||||
if err := os.MkdirAll(corpusDir, 0o755); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -38,7 +37,8 @@ func initCorpus(baseDir string) {
|
||||
for i, datum := range data {
|
||||
filename := filepath.Join(corpusDir, fmt.Sprintf("%d", i))
|
||||
|
||||
if err := os.WriteFile(filename, []byte(datum), 0644); err != nil {
|
||||
//nolint:gosec
|
||||
if err := os.WriteFile(filename, []byte(datum), 0o644); err != nil {
|
||||
log.Fatalf("can't write %v to %q: %v", datum, filename, err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user