diff --git a/.golangci.yaml b/.golangci.yaml index 4a33bc6abf..66ef0d06ae 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -22,8 +22,8 @@ run: linters: disable-all: true enable: + - copyloopvar - errcheck - - exportloopref - gocritic - gosec - govet diff --git a/pkg/cli/push.go b/pkg/cli/push.go index a48a3c8fe9..3a6463a071 100644 --- a/pkg/cli/push.go +++ b/pkg/cli/push.go @@ -68,14 +68,14 @@ func push(cmd *cobra.Command, args []string) error { err = docker.Push(imageName) if err != nil { if strings.Contains(err.Error(), "NAME_UNKNOWN") { - return fmt.Errorf("Unable to find existing Replicate model for %s. " + - "Go to replicate.com and create a new model before pushing." + - "\n\n" + - "If the model already exists, you may be getting this error " + - "because you're not logged in as owner of the model. " + - "This can happen if you did `sudo cog login` instead of `cog login` " + - "or `sudo cog push` instead of `cog push`, " + - "which causes Docker to use the wrong Docker credentials." + + return fmt.Errorf("Unable to find existing Replicate model for %s. "+ + "Go to replicate.com and create a new model before pushing."+ + "\n\n"+ + "If the model already exists, you may be getting this error "+ + "because you're not logged in as owner of the model. "+ + "This can happen if you did `sudo cog login` instead of `cog login` "+ + "or `sudo cog push` instead of `cog push`, "+ + "which causes Docker to use the wrong Docker credentials.", imageName) } return fmt.Errorf("Failed to push image: %w", err) diff --git a/pkg/config/compatibility.go b/pkg/config/compatibility.go index 4f7fc7620e..fdbaaadf88 100644 --- a/pkg/config/compatibility.go +++ b/pkg/config/compatibility.go @@ -300,7 +300,6 @@ func torchGPUPackage(ver string, cuda string) (name, cpuVersion, findLinks, extr // that is at most as high as the requested cuda version var latest *TorchCompatibility for _, compat := range TorchCompatibilityMatrix { - compat := compat if !version.Matches(compat.TorchVersion(), ver) || compat.CUDA == nil { continue } @@ -349,7 +348,6 @@ func torchvisionGPUPackage(ver, cuda string) (name, cpuVersion, findLinks, extra // most as high as the requested cuda version var latest *TorchCompatibility for _, compat := range TorchCompatibilityMatrix { - compat := compat if compat.TorchvisionVersion() != ver || compat.CUDA == nil { continue } diff --git a/pkg/predict/input.go b/pkg/predict/input.go index 113111eba8..6576571711 100644 --- a/pkg/predict/input.go +++ b/pkg/predict/input.go @@ -44,7 +44,6 @@ func NewInputs(keyVals map[string][]string) Inputs { func NewInputsWithBaseDir(keyVals map[string]string, baseDir string) Inputs { input := Inputs{} for key, val := range keyVals { - val := val if strings.HasPrefix(val, "@") { val = filepath.Join(baseDir, val[1:]) input[key] = Input{File: &val} diff --git a/tools/compatgen/main.go b/tools/compatgen/main.go index 826c39a7ec..b91e75396d 100644 --- a/tools/compatgen/main.go +++ b/tools/compatgen/main.go @@ -61,6 +61,6 @@ func main() { rootCmd.Flags().StringVarP(&output, "output", "o", "", "Output flag (optional)") if err := rootCmd.Execute(); err != nil { - console.Fatalf(err.Error()) + console.Fatal(err.Error()) } }