diff --git a/.golangci.yml b/.golangci.yml index 463cadfd..6fae7a43 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -33,6 +33,11 @@ linters-settings: # The io/ioutil package has been deprecated. # https://go.dev/doc/go1.16#ioutil - io/ioutil + gocritic: + # Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint run` to see all tags and checks. + # Empty list by default. See https://github.com/go-critic/go-critic#usage -> section "Tags". + enabled-tags: + - diagnostic gocyclo: min-complexity: 16 lll: diff --git a/cmd/compose/compose.go b/cmd/compose/compose.go index 84f24d8b..eb720a6f 100644 --- a/cmd/compose/compose.go +++ b/cmd/compose/compose.go @@ -355,7 +355,7 @@ func setEnvWithDotEnv(prjOpts *projectOptions) error { } for k, v := range envFromFile { if _, ok := os.LookupEnv(k); !ok { - if err = os.Setenv(k, v); err != nil { + if err := os.Setenv(k, v); err != nil { return err } } diff --git a/pkg/e2e/framework.go b/pkg/e2e/framework.go index 8f49d21c..774c0023 100644 --- a/pkg/e2e/framework.go +++ b/pkg/e2e/framework.go @@ -216,7 +216,7 @@ func (c *CLI) NewCmdWithEnv(envvars []string, command string, args ...string) ic // MetricsSocket get the path where test metrics will be sent func (c *CLI) MetricsSocket() string { - return filepath.Join(c.ConfigDir, "./docker-cli.sock") + return filepath.Join(c.ConfigDir, "docker-cli.sock") } // NewDockerCmd creates a docker cmd without running it