Merge pull request #6669 from henry118/gosec
Enable gosec linter for golangci-lint
This commit is contained in:
commit
ed4cc4b482
@ -11,12 +11,28 @@ linters:
|
||||
- vet
|
||||
- unused
|
||||
- misspell
|
||||
- gosec
|
||||
disable:
|
||||
- errcheck
|
||||
|
||||
issues:
|
||||
include:
|
||||
- EXC0002
|
||||
max-issues-per-linter: 0
|
||||
max-same-issues: 0
|
||||
|
||||
linters-settings:
|
||||
gosec:
|
||||
# The following issues surfaced when `gosec` linter
|
||||
# was enabled. They are temporarily excluded to unblock
|
||||
# the existing workflow, but still to be addressed by
|
||||
# by future works.
|
||||
excludes:
|
||||
- G204
|
||||
- G305
|
||||
- G306
|
||||
- G402
|
||||
- G404
|
||||
|
||||
run:
|
||||
timeout: 8m
|
||||
|
@ -162,6 +162,7 @@ func WriteExtensions(bkt *bolt.Bucket, extensions map[string]types.Any) error {
|
||||
}
|
||||
|
||||
for name, ext := range extensions {
|
||||
ext := ext
|
||||
p, err := proto.Marshal(&ext)
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -152,6 +152,7 @@ func TestContainersList(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, result := range results {
|
||||
result := result
|
||||
checkContainersEqual(t, &result, testset[result.ID], "list results did not match")
|
||||
}
|
||||
})
|
||||
|
@ -129,6 +129,7 @@ func TestImagesList(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, result := range results {
|
||||
result := result
|
||||
checkImagesEqual(t, &result, testset[result.Name], "list results did not match")
|
||||
}
|
||||
})
|
||||
|
@ -596,6 +596,7 @@ func TestDevShmSize(t *testing.T) {
|
||||
|
||||
expected := "1024k"
|
||||
for _, s := range ss {
|
||||
s := s
|
||||
if err := WithDevShmSize(1024)(nil, nil, nil, &s); err != nil {
|
||||
if err != ErrNoShmMount {
|
||||
t.Fatal(err)
|
||||
|
@ -25,6 +25,7 @@ func containersToProto(containers []containers.Container) []api.Container {
|
||||
var containerspb []api.Container
|
||||
|
||||
for _, image := range containers {
|
||||
image := image
|
||||
containerspb = append(containerspb, containerToProto(&image))
|
||||
}
|
||||
|
||||
|
@ -27,6 +27,7 @@ func imagesToProto(images []images.Image) []imagesapi.Image {
|
||||
var imagespb []imagesapi.Image
|
||||
|
||||
for _, image := range images {
|
||||
image := image
|
||||
imagespb = append(imagespb, imageToProto(&image))
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user