Skip to content

Commit 7448dcd

Browse files
committed
chore: lint
1 parent 1e52b52 commit 7448dcd

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

.golangci.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,21 @@ issues:
204204
linters: [gocritic]
205205
text: "rangeValCopy: each iteration copies 160 bytes \\(consider pointers or indexing\\)"
206206

207+
# Related to file sizes.
208+
- path: pkg/goanalysis/runner_loadingpackage.go
209+
linters: [gosec]
210+
text: "G115: integer overflow conversion uintptr -> int"
211+
212+
# Related to PID.
213+
- path: test/bench/bench_test.go
214+
linters: [gosec]
215+
text: "G115: integer overflow conversion int -> int32"
216+
217+
# Related to the result of computation but divided multiple times by 1024.
218+
- path: test/bench/bench_test.go
219+
linters: [gosec]
220+
text: "G115: integer overflow conversion uint64 -> int"
221+
207222
exclude-dirs:
208223
- test/testdata_etc # test files
209224
- internal/cache # extracted from Go code

pkg/goanalysis/runners.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ func saveIssuesToCache(allPkgs []*packages.Package, pkgsFromCache map[*packages.
134134
perPkgIssues[i.Pkg] = append(perPkgIssues[i.Pkg], *i)
135135
}
136136

137-
savedIssuesCount := int32(0)
137+
var savedIssuesCount int64 = 0
138138
lintResKey := getIssuesCacheKey(analyzers)
139139

140140
workerCount := runtime.GOMAXPROCS(-1)
@@ -162,7 +162,7 @@ func saveIssuesToCache(allPkgs []*packages.Package, pkgsFromCache map[*packages.
162162
})
163163
}
164164

165-
atomic.AddInt32(&savedIssuesCount, int32(len(encodedIssues)))
165+
atomic.AddInt64(&savedIssuesCount, int64(len(encodedIssues)))
166166
if err := lintCtx.PkgCache.Put(pkg, pkgcache.HashModeNeedAllDeps, lintResKey, encodedIssues); err != nil {
167167
lintCtx.Log.Infof("Failed to save package %s issues (%d) to cache: %s", pkg, len(pkgIssues), err)
168168
} else {

0 commit comments

Comments
 (0)