diff --git a/cmd/api/main.go b/cmd/api/main.go index 8cd78dda7..bf3b45fc2 100644 --- a/cmd/api/main.go +++ b/cmd/api/main.go @@ -38,6 +38,8 @@ import ( "go.uber.org/zap" "go.uber.org/zap/zapcore" + _ "net/http/pprof" + "github.com/golang-jwt/jwt/v4" grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware" grpc_auth "github.com/grpc-ecosystem/go-grpc-middleware/auth" @@ -63,7 +65,6 @@ import ( "gorm.io/gorm" gormlogger "gorm.io/gorm/logger" "k8s.io/apimachinery/pkg/util/wait" - _ "net/http/pprof" ) func main() { @@ -151,7 +152,7 @@ func main() { // Shared options for the logger, with a custom gRPC code to log level function. zapOpts := []grpc_zap.Option{ - grpc_zap.WithDecider(func(fullMethodName string, err error) bool { + grpc_zap.WithDecider(func(fullMethodName string, _ error) bool { return fullMethodName != healthpb.Health_Check_FullMethodName }), grpc_zap.WithDurationField(func(duration time.Duration) zapcore.Field { diff --git a/pkg/api/server/v1alpha2/log/s3.go b/pkg/api/server/v1alpha2/log/s3.go index 9d5853c2b..d72cb4108 100644 --- a/pkg/api/server/v1alpha2/log/s3.go +++ b/pkg/api/server/v1alpha2/log/s3.go @@ -107,7 +107,7 @@ func initConfig(ctx context.Context, cfg *server.Config) (*s3.Client, error) { var awsConfig aws.Config var err error if len(cfg.S3_ENDPOINT) > 0 { - customResolver := aws.EndpointResolverWithOptionsFunc(func(service, region string, options ...any) (aws.Endpoint, error) { + customResolver := aws.EndpointResolverWithOptionsFunc(func(_, region string, _ ...any) (aws.Endpoint, error) { if region == cfg.S3_REGION { return aws.Endpoint{ URL: cfg.S3_ENDPOINT, diff --git a/pkg/cli/client/client_test.go b/pkg/cli/client/client_test.go index 1bffa32cf..370390ed0 100644 --- a/pkg/cli/client/client_test.go +++ b/pkg/cli/client/client_test.go @@ -50,7 +50,7 @@ func TestToken(t *testing.T) { clientset := fake.NewSimpleClientset() // Token is a subresource of ServiceAccount, so this // operation looks like a SA creation w.r.t. fake clients. - clientset.PrependReactor("create", "serviceaccounts", func(action ktest.Action) (handled bool, ret runtime.Object, err error) { + clientset.PrependReactor("create", "serviceaccounts", func(_ ktest.Action) (handled bool, ret runtime.Object, err error) { return true, &v1.TokenRequest{ Status: v1.TokenRequestStatus{ Token: "a", diff --git a/pkg/cli/cmd/root.go b/pkg/cli/cmd/root.go index fd43016ee..a36e96a39 100644 --- a/pkg/cli/cmd/root.go +++ b/pkg/cli/cmd/root.go @@ -32,7 +32,7 @@ func Root() *cobra.Command { Use: "tkn-results", Short: "tkn CLI plugin for Tekton Results API", Long: help, - PersistentPreRunE: func(cmd *cobra.Command, args []string) error { + PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { var overrideAPIAdr string // Prepare to port-forward if addr config is not set @@ -71,7 +71,7 @@ func Root() *cobra.Command { return nil }, - PersistentPostRun: func(cmd *cobra.Command, args []string) { + PersistentPostRun: func(_ *cobra.Command, _ []string) { if portForwardCloseChan != nil { close(portForwardCloseChan) } diff --git a/pkg/internal/protoutil/protoutil.go b/pkg/internal/protoutil/protoutil.go index cbfc17725..3e31095c0 100644 --- a/pkg/internal/protoutil/protoutil.go +++ b/pkg/internal/protoutil/protoutil.go @@ -52,7 +52,7 @@ func AnyBytes(t testing.TB, m proto.Message) []byte { // ClearOutputOnly clears any proto fields marked as OUTPUT_ONLY. func ClearOutputOnly(pb proto.Message) { m := pb.ProtoReflect() - m.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool { + m.Range(func(fd protoreflect.FieldDescriptor, _ protoreflect.Value) bool { opts := fd.Options().(*descriptorpb.FieldOptions) for _, b := range proto.GetExtension(opts, fbpb.E_FieldBehavior).([]fbpb.FieldBehavior) { if b == fbpb.FieldBehavior_OUTPUT_ONLY { diff --git a/pkg/watcher/reconciler/dynamic/dynamic.go b/pkg/watcher/reconciler/dynamic/dynamic.go index 5615dc208..c80c07d58 100644 --- a/pkg/watcher/reconciler/dynamic/dynamic.go +++ b/pkg/watcher/reconciler/dynamic/dynamic.go @@ -83,7 +83,7 @@ func NewDynamicReconciler(rc pb.ResultsClient, lc pb.LogsClient, oc ObjectClient objectClient: oc, cfg: cfg, // Always true predicate. - IsReadyForDeletionFunc: func(ctx context.Context, object results.Object) (bool, error) { + IsReadyForDeletionFunc: func(_ context.Context, _ results.Object) (bool, error) { return true, nil }, } diff --git a/pkg/watcher/reconciler/dynamic/dynamic_test.go b/pkg/watcher/reconciler/dynamic/dynamic_test.go index 6c3f4f185..6ebf1f38e 100644 --- a/pkg/watcher/reconciler/dynamic/dynamic_test.go +++ b/pkg/watcher/reconciler/dynamic/dynamic_test.go @@ -294,7 +294,7 @@ func TestReconcile_TaskRun(t *testing.T) { // Pretend that the IsReadyForDeletion function returns an // error. errSomethingBad := errors.New("Something really bad happened") - r.IsReadyForDeletionFunc = func(_ context.Context, object watcherresults.Object) (bool, error) { + r.IsReadyForDeletionFunc = func(_ context.Context, _ watcherresults.Object) (bool, error) { return false, errSomethingBad }