From f9aba28ca765abaf5b11ea6869eff31ea3e15e7b Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Wed, 13 Sep 2023 11:39:05 +0200 Subject: [PATCH] make golangci-lint happy First do not lint pkg/domain/infra/abi with the remote tag as this is only local code. Then mark the cacheLibImage field as unused, this should be an unused stub for the remote client so that we do not leak libimage. The linter sees that with the remote tag so we need to silence that warning. Signed-off-by: Paul Holzinger --- hack/golangci-lint.sh | 2 +- pkg/specgen/specgen.go | 2 ++ pkg/specgen/specgen_remote.go | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hack/golangci-lint.sh b/hack/golangci-lint.sh index 175df66bc8..7c8237e2eb 100755 --- a/hack/golangci-lint.sh +++ b/hack/golangci-lint.sh @@ -11,7 +11,7 @@ BUILD_TAGS[tunnel]="${BUILD_TAGS[default]},remote" declare -A SKIP_DIRS SKIP_DIRS[abi]="" # TODO: add "remote" build tag to pkg/api -SKIP_DIRS[tunnel]="pkg/api" +SKIP_DIRS[tunnel]="pkg/api,pkg/domain/infra/abi" [[ $1 == run ]] && shift diff --git a/pkg/specgen/specgen.go b/pkg/specgen/specgen.go index 12b9e06854..eca9a9bcc3 100644 --- a/pkg/specgen/specgen.go +++ b/pkg/specgen/specgen.go @@ -569,6 +569,8 @@ type SpecGenerator struct { ContainerResourceConfig ContainerHealthCheckConfig + //nolint:unused // this is needed for the local client but golangci-lint + // does not seems to happy when we test the remote stub cacheLibImage } diff --git a/pkg/specgen/specgen_remote.go b/pkg/specgen/specgen_remote.go index d6c6102846..806aed73b1 100644 --- a/pkg/specgen/specgen_remote.go +++ b/pkg/specgen/specgen_remote.go @@ -5,4 +5,6 @@ package specgen // Empty stub we do not use any libimage on the remote client, // this drastically decreases binary size for the remote client. +// +//nolint:unused // this is needed for the local client type cacheLibImage struct{}