From ccadf658cae2215faecaf659a8ab2e57dcb667cb Mon Sep 17 00:00:00 2001 From: Fahim Ahmed Date: Fri, 10 Jan 2025 14:28:25 -0500 Subject: [PATCH 1/3] fix make lint by updating staticcheck fixes `panic: Cannot range over: func(yield func(K, V) bool)` seen in the older version of staticcheck --- .github/workflows/checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index d264efc..f2ac385 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -40,7 +40,7 @@ jobs: run: go install mvdan.cc/gofumpt@v0.6.0 - name: Install staticcheck - run: go install honnef.co/go/tools/cmd/staticcheck@v0.4.7 + run: go install honnef.co/go/tools/cmd/staticcheck@v0.5.1 - name: Install golangci-lint run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.56.2 From 6b00ee4586fb5b57c25d94c8a4bd4225835b5f50 Mon Sep 17 00:00:00 2001 From: fahimahmedx Date: Fri, 10 Jan 2025 14:37:21 -0500 Subject: [PATCH 2/3] fix lint --- common/analyzer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/analyzer.go b/common/analyzer.go index adadc8f..7fbccde 100644 --- a/common/analyzer.go +++ b/common/analyzer.go @@ -246,7 +246,7 @@ func (a *Analyzer2) Sprint() string { out += Printer.Sprintf("- Included on-chain: %10d (%5s) \n", a.nIncluded, Int64DiffPercentFmt(a.nIncluded, a.nUniqueTransactions, 1)) out += Printer.Sprintf("- Not included: %10d (%5s) \n", a.nNotIncluded, Int64DiffPercentFmt(a.nNotIncluded, a.nUniqueTransactions, 1)) - if a.Sourelog == nil || len(a.Sourelog) == 0 { + if len(a.Sourelog) == 0 { return out } From 897ce30497fcf1412ae02f339c3d9240cd81e288 Mon Sep 17 00:00:00 2001 From: fahimahmedx Date: Fri, 10 Jan 2025 14:58:30 -0500 Subject: [PATCH 3/3] fix another lint? --- cmd/analyze/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/analyze/main.go b/cmd/analyze/main.go index 1401ae0..ebc5606 100644 --- a/cmd/analyze/main.go +++ b/cmd/analyze/main.go @@ -15,7 +15,7 @@ import ( var ( version = "dev" // is set during build process debug = os.Getenv("DEBUG") == "1" - max = common.GetEnvInt("MAX", 0) + maxEnv = common.GetEnvInt("MAX", 0) // Helpers log *zap.SugaredLogger @@ -119,7 +119,7 @@ func analyzeV2(cCtx *cli.Context) error { log.Infow(common.Printer.Sprintf("- Loaded %10d / %d rows", i, num), "memUsed", common.GetMemUsageHuman()) } entries[stus[0].Hash] = &stus[0] - if i+1 == max { + if i+1 == maxEnv { break } }