From 21114c98bed63fcb2b3085d886ba94b2ef8ed72a Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Mon, 27 May 2024 04:56:54 +0200 Subject: [PATCH] ci(deps): fix govet in ".*_test.go$" (#6736) Signed-off-by: Matthieu MOREL --- .golangci.yaml | 5 ++++- pkg/dependency/parser/java/jar/parse_test.go | 2 +- pkg/fanal/analyzer/imgconf/apk/apk_test.go | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index 235a833a3c45..f4957e6658ae 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -112,10 +112,13 @@ issues: - bodyclose - goconst - gosec - - govet - ineffassign - misspell - unused + - path: ".*_test.go$" + linters: + - govet + text: "copylocks:" - path: ".*_test.go$" linters: - gocritic diff --git a/pkg/dependency/parser/java/jar/parse_test.go b/pkg/dependency/parser/java/jar/parse_test.go index ccf1adc9f73d..20f9c682be3b 100644 --- a/pkg/dependency/parser/java/jar/parse_test.go +++ b/pkg/dependency/parser/java/jar/parse_test.go @@ -203,7 +203,7 @@ type doc struct { ArtifactID string `json:"a"` Version string `json:"v"` P string `json:"p"` - VersionCount int `json:versionCount` + VersionCount int `json:"versionCount"` } func TestParse(t *testing.T) { diff --git a/pkg/fanal/analyzer/imgconf/apk/apk_test.go b/pkg/fanal/analyzer/imgconf/apk/apk_test.go index 9d6449c92808..8577d5c3c054 100644 --- a/pkg/fanal/analyzer/imgconf/apk/apk_test.go +++ b/pkg/fanal/analyzer/imgconf/apk/apk_test.go @@ -202,7 +202,7 @@ var ( }, { Created: v1.Time{ - time.Date(2018, time.October, 15, 21, 28, 51, 35012363, time.UTC), + Time: time.Date(2018, time.October, 15, 21, 28, 51, 35012363, time.UTC), }, CreatedBy: "/bin/sh -c #(nop) ENV COMPOSER_VERSION=1.7.2", EmptyLayer: true, @@ -234,7 +234,7 @@ var ( }, { Created: v1.Time{ - time.Date(2018, time.October, 15, 21, 28, 53, 798628678, time.UTC), + Time: time.Date(2018, time.October, 15, 21, 28, 53, 798628678, time.UTC), }, CreatedBy: "/bin/sh -c #(nop) CMD [\"composer\"]", EmptyLayer: true,