diff --git a/pkg/build/recorder_test.go b/pkg/build/recorder_test.go index f113fb049d..94db0a436d 100644 --- a/pkg/build/recorder_test.go +++ b/pkg/build/recorder_test.go @@ -101,7 +101,7 @@ func TestBuildRecording(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { inner := &fake{ - b: func(ip string) (Result, error) { + b: func(_ string) (Result, error) { return nil, nil }, } diff --git a/pkg/commands/resolve.go b/pkg/commands/resolve.go index baed305498..95ea5e1414 100644 --- a/pkg/commands/resolve.go +++ b/pkg/commands/resolve.go @@ -54,7 +54,7 @@ func addResolve(topLevel *cobra.Command) { # This always preserves import paths. ko resolve --local -f config/`, Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { if err := options.Validate(po, bo); err != nil { return fmt.Errorf("validating options: %w", err) } diff --git a/pkg/commands/root.go b/pkg/commands/root.go index 81398f21c3..12fd558340 100644 --- a/pkg/commands/root.go +++ b/pkg/commands/root.go @@ -32,7 +32,7 @@ func New() *cobra.Command { Short: "Rapidly iterate with Go, Containers, and Kubernetes.", SilenceUsage: true, // Don't show usage on errors DisableAutoGenTag: true, - PersistentPreRun: func(cmd *cobra.Command, args []string) { + PersistentPreRun: func(_ *cobra.Command, _ []string) { if verbose { logs.Warn.SetOutput(os.Stderr) logs.Debug.SetOutput(os.Stderr) @@ -41,7 +41,7 @@ func New() *cobra.Command { maxprocs.Set(maxprocs.Logger(logs.Debug.Printf)) }, - Run: func(cmd *cobra.Command, args []string) { + Run: func(cmd *cobra.Command, _ []string) { cmd.Help() }, } diff --git a/pkg/commands/version.go b/pkg/commands/version.go index e22d4fab50..630ed1ad2b 100644 --- a/pkg/commands/version.go +++ b/pkg/commands/version.go @@ -29,7 +29,7 @@ func addVersion(topLevel *cobra.Command) { topLevel.AddCommand(&cobra.Command{ Use: "version", Short: `Print ko version.`, - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { v := version() if v == "" { fmt.Println("could not determine build information") diff --git a/pkg/publish/recorder.go b/pkg/publish/recorder.go index 83301dc76b..c886b5c909 100644 --- a/pkg/publish/recorder.go +++ b/pkg/publish/recorder.go @@ -55,7 +55,7 @@ func (r *recorder) Publish(ctx context.Context, br build.Result, ref string) (na references := make([]string, 0, 20 /* just try to avoid resizing*/) switch t := br.(type) { case oci.SignedImageIndex: - if err := walk.SignedEntity(ctx, t, func(ctx context.Context, se oci.SignedEntity) error { + if err := walk.SignedEntity(ctx, t, func(_ context.Context, se oci.SignedEntity) error { // Both of the SignedEntity types implement Digest() h, err := se.(interface{ Digest() (v1.Hash, error) }).Digest() if err != nil { diff --git a/pkg/publish/recorder_test.go b/pkg/publish/recorder_test.go index e81c5f84b4..06079c3aeb 100644 --- a/pkg/publish/recorder_test.go +++ b/pkg/publish/recorder_test.go @@ -42,7 +42,7 @@ func (sp *cbPublish) Close() error { func TestRecorder(t *testing.T) { repo := name.MustParseReference("docker.io/ubuntu:latest") - inner := &cbPublish{cb: func(c context.Context, b build.Result, s string) (name.Reference, error) { + inner := &cbPublish{cb: func(_ context.Context, b build.Result, _ string) (name.Reference, error) { h, err := b.Digest() if err != nil { return nil, err