Skip to content

Commit

Permalink
Fix new lint errors
Browse files Browse the repository at this point in the history
Signed-off-by: Phil Estes <[email protected]>
  • Loading branch information
estesp committed Oct 2, 2024
1 parent 3cd5bdb commit f31e3f8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions v2/cmd/manifest-tool/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ import (
yaml "gopkg.in/yaml.v3"
)

const (
fmtCantResolvePath = "Can't resolve path to %q: %v"
fmtCantReadYAML = "Can't read YAML file %q: %v"
fmtCantUnmarshalYAML = "Can't unmarshal YAML file %q: %v"
)

var pushCmd = &cli.Command{
Name: "push",
Usage: "push a manifest list/OCI index entry to a registry with provided image details",
Expand All @@ -41,15 +47,15 @@ var pushCmd = &cli.Command{

filename, err := filepath.Abs(filePath)
if err != nil {
logrus.Fatalf(fmt.Sprintf("Can't resolve path to %q: %v", filePath, err))
logrus.Fatalf(fmt.Sprintf(fmtCantResolvePath, filePath, err))

Check failure on line 50 in v2/cmd/manifest-tool/push.go

View workflow job for this annotation

GitHub Actions / Linters (1.23.2, ubuntu-20.04)

printf: non-constant format string in call to github.com/sirupsen/logrus.Fatalf (govet)
}
yamlFile, err := os.ReadFile(filename)
if err != nil {
logrus.Fatalf(fmt.Sprintf("Can't read YAML file %q: %v", filePath, err))
logrus.Fatalf(fmt.Sprintf(fmtCantReadYAML, filePath, err))

Check failure on line 54 in v2/cmd/manifest-tool/push.go

View workflow job for this annotation

GitHub Actions / Linters (1.23.2, ubuntu-20.04)

printf: non-constant format string in call to github.com/sirupsen/logrus.Fatalf (govet)
}
err = yaml.Unmarshal(yamlFile, &yamlInput)
if err != nil {
logrus.Fatalf(fmt.Sprintf("Can't unmarshal YAML file %q: %v", filePath, err))
logrus.Fatalf(fmt.Sprintf(fmtCantUnmarshalYAML, filePath, err))

Check failure on line 58 in v2/cmd/manifest-tool/push.go

View workflow job for this annotation

GitHub Actions / Linters (1.23.2, ubuntu-20.04)

printf: non-constant format string in call to github.com/sirupsen/logrus.Fatalf (govet)
}

manifestType := types.Docker
Expand Down

0 comments on commit f31e3f8

Please sign in to comment.