containerd/metadata
Henry Wang b8bf504e94 Enable gosec linter for golangci-lint
`gosec` linter is able to identify issues described in #6584

e.g.

$ git revert 54e95e6b88
[gosec dfc8ca1ec] Revert "fix Implicit memory aliasing in for loop"
 2 files changed, 2 deletions(-)

$ make check
+ proto-fmt
+ check
GOGC=75 golangci-lint run
containerstore.go:192:54: G601: Implicit memory aliasing in for loop. (gosec)
		containers = append(containers, containerFromProto(&container))
		                                                   ^
image_store.go:132:42: G601: Implicit memory aliasing in for loop. (gosec)
		images = append(images, imageFromProto(&image))
		                                       ^
make: *** [check] Error 1

I also disabled following two settings which prevent the linter to show a complete list of issues.

* max-issues-per-linter (default 50)
* max-same-issues (default 3)

Furthermore enabling gosec revealed many other issues. For now I blacklisted the ones except G601.

Will create separate tasks to address them one by one moving next.

Signed-off-by: Henry Wang <henwang@amazon.com>
2022-03-14 22:50:54 +00:00
..
boltutil Enable gosec linter for golangci-lint 2022-03-14 22:50:54 +00:00
adaptors.go content: support filters on local.store#Walk() 2020-11-11 11:17:48 -08:00
bolt.go feat: replace github.com/pkg/errors to errors 2022-01-07 10:27:03 +08:00
buckets.go Revert "Add shared content label to namespaces" 2022-01-12 16:38:06 -08:00
containers_test.go Enable gosec linter for golangci-lint 2022-03-14 22:50:54 +00:00
containers.go feat: replace github.com/pkg/errors to errors 2022-01-07 10:27:03 +08:00
content_test.go feat: replace github.com/pkg/errors to errors 2022-01-07 10:27:03 +08:00
content.go docs: add doc-comments on GC-related methods 2022-01-24 14:26:14 -08:00
db_test.go feat: replace github.com/pkg/errors to errors 2022-01-07 10:27:03 +08:00
db.go docs: add doc-comments on GC-related methods 2022-01-24 14:26:14 -08:00
gc_test.go refactor: move from io/ioutil to io and os package 2021-09-21 09:50:38 +08:00
gc.go docs: add doc-comments on GC-related methods 2022-01-24 14:26:14 -08:00
images_test.go Enable gosec linter for golangci-lint 2022-03-14 22:50:54 +00:00
images.go Revert "Add shared content label to namespaces" 2022-01-12 16:38:06 -08:00
leases_test.go feat: replace github.com/pkg/errors to errors 2022-01-07 10:27:03 +08:00
leases.go feat: replace github.com/pkg/errors to errors 2022-01-07 10:27:03 +08:00
migrations.go Adds a no-op migration for metadata v3 2018-09-12 15:33:42 -07:00
namespaces_test.go medatada: make namespaces' deletion error less cryptic 2021-12-13 09:28:24 -08:00
namespaces.go feat: replace github.com/pkg/errors to errors 2022-01-07 10:27:03 +08:00
snapshot_test.go feat: replace github.com/pkg/errors to errors 2022-01-07 10:27:03 +08:00
snapshot.go docs: add doc-comments on GC-related methods 2022-01-24 14:26:14 -08:00