diff --git a/pkg/api/server/cel/cel.go b/pkg/api/server/cel/cel.go index e2da6cc7f..4399db74c 100644 --- a/pkg/api/server/cel/cel.go +++ b/pkg/api/server/cel/cel.go @@ -60,16 +60,16 @@ func ParseFilter(env *cel.Env, filter string) (cel.Program, error) { // allowAll is a CEL program implementation that always returns true. type allowAll struct{} -func (allowAll) ContextEval(context.Context, interface{}) (ref.Val, *cel.EvalDetails, error) { +func (allowAll) ContextEval(context.Context, any) (ref.Val, *cel.EvalDetails, error) { return types.Bool(true), nil, nil } -func (allowAll) Eval(interface{}) (ref.Val, *cel.EvalDetails, error) { +func (allowAll) Eval(any) (ref.Val, *cel.EvalDetails, error) { return types.Bool(true), nil, nil } // Match determines whether the given CEL filter matches the result. -func Match(prg cel.Program, data map[string]interface{}) (bool, error) { +func Match(prg cel.Program, data map[string]any) (bool, error) { if prg == nil { return true, nil } diff --git a/pkg/api/server/db/model.go b/pkg/api/server/db/model.go index 5d0faacd5..10180ba1a 100644 --- a/pkg/api/server/db/model.go +++ b/pkg/api/server/db/model.go @@ -83,7 +83,7 @@ type Annotations map[string]string // Scan resolves serialized data read from database into an Annotation. // This implements the sql.Scanner interface. -func (ann *Annotations) Scan(value interface{}) error { +func (ann *Annotations) Scan(value any) error { if ann == nil { return errors.New("the annotation pointer mustn't be nil") } diff --git a/pkg/api/server/db/pagination/proto/internal_go_proto/pagination.pb.go b/pkg/api/server/db/pagination/proto/internal_go_proto/pagination.pb.go index ee5f3cecc..ae67b9a85 100644 --- a/pkg/api/server/db/pagination/proto/internal_go_proto/pagination.pb.go +++ b/pkg/api/server/db/pagination/proto/internal_go_proto/pagination.pb.go @@ -113,7 +113,7 @@ func file_pagination_proto_rawDescGZIP() []byte { } var file_pagination_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_pagination_proto_goTypes = []interface{}{ +var file_pagination_proto_goTypes = []any{ (*ListPageIdentifier)(nil), // 0: tekton.results.internal.ListPageIdentifier } var file_pagination_proto_depIdxs = []int32{ @@ -130,7 +130,7 @@ func file_pagination_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_pagination_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_pagination_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*ListPageIdentifier); i { case 0: return &v.state diff --git a/pkg/api/server/test/db.go b/pkg/api/server/test/db.go index fe7e0569c..80fd6d54a 100644 --- a/pkg/api/server/test/db.go +++ b/pkg/api/server/test/db.go @@ -65,6 +65,6 @@ type testLogger struct { t *testing.T } -func (t *testLogger) Printf(format string, args ...interface{}) { +func (t *testLogger) Printf(format string, args ...any) { t.t.Logf(format, args...) } diff --git a/pkg/api/server/v1alpha2/lister/proto/pagetoken_go_proto/page_token.pb.go b/pkg/api/server/v1alpha2/lister/proto/pagetoken_go_proto/page_token.pb.go index 31500cd31..a3434f881 100644 --- a/pkg/api/server/v1alpha2/lister/proto/pagetoken_go_proto/page_token.pb.go +++ b/pkg/api/server/v1alpha2/lister/proto/pagetoken_go_proto/page_token.pb.go @@ -316,7 +316,7 @@ func file_page_token_proto_rawDescGZIP() []byte { var file_page_token_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_page_token_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_page_token_proto_goTypes = []interface{}{ +var file_page_token_proto_goTypes = []any{ (Order_Direction)(0), // 0: tekton.results.lister.Order.Direction (*PageToken)(nil), // 1: tekton.results.lister.PageToken (*Item)(nil), // 2: tekton.results.lister.Item @@ -341,7 +341,7 @@ func file_page_token_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_page_token_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_page_token_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*PageToken); i { case 0: return &v.state @@ -353,7 +353,7 @@ func file_page_token_proto_init() { return nil } } - file_page_token_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_page_token_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*Item); i { case 0: return &v.state @@ -365,7 +365,7 @@ func file_page_token_proto_init() { return nil } } - file_page_token_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_page_token_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*Order); i { case 0: return &v.state diff --git a/pkg/api/server/v1alpha2/log/s3.go b/pkg/api/server/v1alpha2/log/s3.go index 8735e6fba..9d5853c2b 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 ...interface{}) (aws.Endpoint, error) { + customResolver := aws.EndpointResolverWithOptionsFunc(func(service, region string, options ...any) (aws.Endpoint, error) { if region == cfg.S3_REGION { return aws.Endpoint{ URL: cfg.S3_ENDPOINT, diff --git a/pkg/api/server/v1alpha2/record/record.go b/pkg/api/server/v1alpha2/record/record.go index 4fc2c0649..21e3f332b 100644 --- a/pkg/api/server/v1alpha2/record/record.go +++ b/pkg/api/server/v1alpha2/record/record.go @@ -144,14 +144,14 @@ func Match(r *pb.Record, prg cel.Program) (bool, error) { return false, nil } - var m map[string]interface{} + var m map[string]any if d := r.GetData().GetValue(); d != nil { if err := json.Unmarshal(r.GetData().GetValue(), &m); err != nil { return false, err } } - return resultscel.Match(prg, map[string]interface{}{ + return resultscel.Match(prg, map[string]any{ "name": r.GetName(), "data_type": r.GetData().GetType(), "data": m, diff --git a/pkg/api/server/v1alpha2/result/result.go b/pkg/api/server/v1alpha2/result/result.go index 9f79cbe55..6a2bf0535 100644 --- a/pkg/api/server/v1alpha2/result/result.go +++ b/pkg/api/server/v1alpha2/result/result.go @@ -155,7 +155,7 @@ func Match(r *pb.Result, prg cel.Program) (bool, error) { if r == nil { return false, nil } - return resultscel.Match(prg, map[string]interface{}{ + return resultscel.Match(prg, map[string]any{ "result": r, }) } diff --git a/pkg/apis/config/store.go b/pkg/apis/config/store.go index eb3a92da4..edcde44e7 100644 --- a/pkg/apis/config/store.go +++ b/pkg/apis/config/store.go @@ -34,7 +34,7 @@ type Store struct { } // NewStore creates a new store of Configs and optionally calls functions when ConfigMaps are updated. -func NewStore(logger configmap.Logger, onAfterStore ...func(name string, value interface{})) *Store { +func NewStore(logger configmap.Logger, onAfterStore ...func(name string, value any)) *Store { store := &Store{ UntypedStore: configmap.NewUntypedStore( "results", diff --git a/pkg/internal/jsonutil/jsonutil.go b/pkg/internal/jsonutil/jsonutil.go index df34e04f3..c22452171 100644 --- a/pkg/internal/jsonutil/jsonutil.go +++ b/pkg/internal/jsonutil/jsonutil.go @@ -7,9 +7,9 @@ import ( // AnyBytes returns the marshalled bytes of an Any proto wrapping the given // message, or causes the test to fail. -func AnyBytes(t testing.TB, i interface{}) []byte { +func AnyBytes(t testing.TB, v any) []byte { t.Helper() - b, err := json.Marshal(i) + b, err := json.Marshal(v) if err != nil { t.Fatalf("error marshalling Any proto: %v", err) } diff --git a/pkg/pipelinerunmetrics/metrics.go b/pkg/pipelinerunmetrics/metrics.go index 68931dcd8..3f6396164 100644 --- a/pkg/pipelinerunmetrics/metrics.go +++ b/pkg/pipelinerunmetrics/metrics.go @@ -87,8 +87,8 @@ func viewUnregister(logger *zap.SugaredLogger) { // MetricsOnStore returns a function that checks if metrics are configured for a config.Store, and registers it if so func MetricsOnStore(logger *zap.SugaredLogger) func(name string, - value interface{}) { - return func(name string, value interface{}) { + value any) { + return func(name string, value any) { if name != config.GetMetricsConfigName() { return } diff --git a/pkg/taskrunmetrics/metrics.go b/pkg/taskrunmetrics/metrics.go index 9361af236..a458651ba 100644 --- a/pkg/taskrunmetrics/metrics.go +++ b/pkg/taskrunmetrics/metrics.go @@ -97,8 +97,8 @@ func viewUnregister(logger *zap.SugaredLogger) { // MetricsOnStore returns a function that checks if metrics are configured for a config.Store, and registers it if so func MetricsOnStore(logger *zap.SugaredLogger) func(name string, - value interface{}) { - return func(name string, value interface{}) { + value any) { + return func(name string, value any) { if name != config.GetMetricsConfigName() { return } diff --git a/pkg/watcher/convert/convert_test.go b/pkg/watcher/convert/convert_test.go index 6e561d560..fc2edfce8 100644 --- a/pkg/watcher/convert/convert_test.go +++ b/pkg/watcher/convert/convert_test.go @@ -311,8 +311,8 @@ func TestToProto(t *testing.T) { } -func toJSON(i interface{}) []byte { - b, err := json.Marshal(i) +func toJSON(v any) []byte { + b, err := json.Marshal(v) if err != nil { panic(fmt.Sprintf("error marshalling json: %v", err)) } diff --git a/proto/pipeline/v1beta1/pipeline_go_proto/common.pb.go b/proto/pipeline/v1beta1/pipeline_go_proto/common.pb.go index 9c1cd0314..5e16b7a51 100644 --- a/proto/pipeline/v1beta1/pipeline_go_proto/common.pb.go +++ b/proto/pipeline/v1beta1/pipeline_go_proto/common.pb.go @@ -316,7 +316,7 @@ func file_common_proto_rawDescGZIP() []byte { } var file_common_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_common_proto_goTypes = []interface{}{ +var file_common_proto_goTypes = []any{ (*ObjectMeta)(nil), // 0: tekton.pipeline.v1beta1.ObjectMeta (*Condition)(nil), // 1: tekton.pipeline.v1beta1.Condition nil, // 2: tekton.pipeline.v1beta1.ObjectMeta.LabelsEntry @@ -342,7 +342,7 @@ func file_common_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_common_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*ObjectMeta); i { case 0: return &v.state @@ -354,7 +354,7 @@ func file_common_proto_init() { return nil } } - file_common_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_common_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*Condition); i { case 0: return &v.state diff --git a/proto/pipeline/v1beta1/pipeline_go_proto/pipelinerun.pb.go b/proto/pipeline/v1beta1/pipeline_go_proto/pipelinerun.pb.go index 899f14458..e55fc719f 100644 --- a/proto/pipeline/v1beta1/pipeline_go_proto/pipelinerun.pb.go +++ b/proto/pipeline/v1beta1/pipeline_go_proto/pipelinerun.pb.go @@ -897,7 +897,7 @@ func file_pipelinerun_proto_rawDescGZIP() []byte { } var file_pipelinerun_proto_msgTypes = make([]protoimpl.MessageInfo, 14) -var file_pipelinerun_proto_goTypes = []interface{}{ +var file_pipelinerun_proto_goTypes = []any{ (*PipelineRun)(nil), // 0: tekton.pipeline.v1beta1.PipelineRun (*PipelineRunSpec)(nil), // 1: tekton.pipeline.v1beta1.PipelineRunSpec (*PipelineSpec)(nil), // 2: tekton.pipeline.v1beta1.PipelineSpec @@ -961,7 +961,7 @@ func file_pipelinerun_proto_init() { file_common_proto_init() file_taskrun_proto_init() if !protoimpl.UnsafeEnabled { - file_pipelinerun_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_pipelinerun_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*PipelineRun); i { case 0: return &v.state @@ -973,7 +973,7 @@ func file_pipelinerun_proto_init() { return nil } } - file_pipelinerun_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_pipelinerun_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*PipelineRunSpec); i { case 0: return &v.state @@ -985,7 +985,7 @@ func file_pipelinerun_proto_init() { return nil } } - file_pipelinerun_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_pipelinerun_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*PipelineSpec); i { case 0: return &v.state @@ -997,7 +997,7 @@ func file_pipelinerun_proto_init() { return nil } } - file_pipelinerun_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_pipelinerun_proto_msgTypes[3].Exporter = func(v any, i int) any { switch v := v.(*PipelineTask); i { case 0: return &v.state @@ -1009,7 +1009,7 @@ func file_pipelinerun_proto_init() { return nil } } - file_pipelinerun_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_pipelinerun_proto_msgTypes[4].Exporter = func(v any, i int) any { switch v := v.(*TaskRef); i { case 0: return &v.state @@ -1021,7 +1021,7 @@ func file_pipelinerun_proto_init() { return nil } } - file_pipelinerun_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_pipelinerun_proto_msgTypes[5].Exporter = func(v any, i int) any { switch v := v.(*EmbeddedTask); i { case 0: return &v.state @@ -1033,7 +1033,7 @@ func file_pipelinerun_proto_init() { return nil } } - file_pipelinerun_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_pipelinerun_proto_msgTypes[6].Exporter = func(v any, i int) any { switch v := v.(*PipelineTaskMetadata); i { case 0: return &v.state @@ -1045,7 +1045,7 @@ func file_pipelinerun_proto_init() { return nil } } - file_pipelinerun_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_pipelinerun_proto_msgTypes[7].Exporter = func(v any, i int) any { switch v := v.(*PipelineResult); i { case 0: return &v.state @@ -1057,7 +1057,7 @@ func file_pipelinerun_proto_init() { return nil } } - file_pipelinerun_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_pipelinerun_proto_msgTypes[8].Exporter = func(v any, i int) any { switch v := v.(*PipelineRunStatus); i { case 0: return &v.state @@ -1069,7 +1069,7 @@ func file_pipelinerun_proto_init() { return nil } } - file_pipelinerun_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_pipelinerun_proto_msgTypes[9].Exporter = func(v any, i int) any { switch v := v.(*PipelineRunTaskRunStatus); i { case 0: return &v.state diff --git a/proto/pipeline/v1beta1/pipeline_go_proto/taskrun.pb.go b/proto/pipeline/v1beta1/pipeline_go_proto/taskrun.pb.go index 083b6dd5c..44ea7c4e8 100644 --- a/proto/pipeline/v1beta1/pipeline_go_proto/taskrun.pb.go +++ b/proto/pipeline/v1beta1/pipeline_go_proto/taskrun.pb.go @@ -1168,7 +1168,7 @@ func file_taskrun_proto_rawDescGZIP() []byte { } var file_taskrun_proto_msgTypes = make([]protoimpl.MessageInfo, 13) -var file_taskrun_proto_goTypes = []interface{}{ +var file_taskrun_proto_goTypes = []any{ (*TaskRun)(nil), // 0: tekton.pipeline.v1beta1.TaskRun (*TaskRunSpec)(nil), // 1: tekton.pipeline.v1beta1.TaskRunSpec (*TaskSpec)(nil), // 2: tekton.pipeline.v1beta1.TaskSpec @@ -1224,7 +1224,7 @@ func file_taskrun_proto_init() { } file_common_proto_init() if !protoimpl.UnsafeEnabled { - file_taskrun_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_taskrun_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*TaskRun); i { case 0: return &v.state @@ -1236,7 +1236,7 @@ func file_taskrun_proto_init() { return nil } } - file_taskrun_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_taskrun_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*TaskRunSpec); i { case 0: return &v.state @@ -1248,7 +1248,7 @@ func file_taskrun_proto_init() { return nil } } - file_taskrun_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_taskrun_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*TaskSpec); i { case 0: return &v.state @@ -1260,7 +1260,7 @@ func file_taskrun_proto_init() { return nil } } - file_taskrun_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_taskrun_proto_msgTypes[3].Exporter = func(v any, i int) any { switch v := v.(*Step); i { case 0: return &v.state @@ -1272,7 +1272,7 @@ func file_taskrun_proto_init() { return nil } } - file_taskrun_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_taskrun_proto_msgTypes[4].Exporter = func(v any, i int) any { switch v := v.(*EnvVar); i { case 0: return &v.state @@ -1284,7 +1284,7 @@ func file_taskrun_proto_init() { return nil } } - file_taskrun_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_taskrun_proto_msgTypes[5].Exporter = func(v any, i int) any { switch v := v.(*Volume); i { case 0: return &v.state @@ -1296,7 +1296,7 @@ func file_taskrun_proto_init() { return nil } } - file_taskrun_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_taskrun_proto_msgTypes[6].Exporter = func(v any, i int) any { switch v := v.(*EmptyDir); i { case 0: return &v.state @@ -1308,7 +1308,7 @@ func file_taskrun_proto_init() { return nil } } - file_taskrun_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_taskrun_proto_msgTypes[7].Exporter = func(v any, i int) any { switch v := v.(*VolumeMount); i { case 0: return &v.state @@ -1320,7 +1320,7 @@ func file_taskrun_proto_init() { return nil } } - file_taskrun_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_taskrun_proto_msgTypes[8].Exporter = func(v any, i int) any { switch v := v.(*TaskRunStatus); i { case 0: return &v.state @@ -1332,7 +1332,7 @@ func file_taskrun_proto_init() { return nil } } - file_taskrun_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_taskrun_proto_msgTypes[9].Exporter = func(v any, i int) any { switch v := v.(*StepState); i { case 0: return &v.state @@ -1344,7 +1344,7 @@ func file_taskrun_proto_init() { return nil } } - file_taskrun_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_taskrun_proto_msgTypes[10].Exporter = func(v any, i int) any { switch v := v.(*ContainerStateWaiting); i { case 0: return &v.state @@ -1356,7 +1356,7 @@ func file_taskrun_proto_init() { return nil } } - file_taskrun_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_taskrun_proto_msgTypes[11].Exporter = func(v any, i int) any { switch v := v.(*ContainerStateRunning); i { case 0: return &v.state @@ -1368,7 +1368,7 @@ func file_taskrun_proto_init() { return nil } } - file_taskrun_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_taskrun_proto_msgTypes[12].Exporter = func(v any, i int) any { switch v := v.(*ContainerStateTerminated); i { case 0: return &v.state @@ -1381,10 +1381,10 @@ func file_taskrun_proto_init() { } } } - file_taskrun_proto_msgTypes[5].OneofWrappers = []interface{}{ + file_taskrun_proto_msgTypes[5].OneofWrappers = []any{ (*Volume_EmptyDir)(nil), } - file_taskrun_proto_msgTypes[9].OneofWrappers = []interface{}{ + file_taskrun_proto_msgTypes[9].OneofWrappers = []any{ (*StepState_Waiting)(nil), (*StepState_Running)(nil), (*StepState_Terminated)(nil), diff --git a/proto/v1alpha2/results_go_proto/api.pb.go b/proto/v1alpha2/results_go_proto/api.pb.go index f439b055f..e8634b892 100644 --- a/proto/v1alpha2/results_go_proto/api.pb.go +++ b/proto/v1alpha2/results_go_proto/api.pb.go @@ -1130,7 +1130,7 @@ func file_api_proto_rawDescGZIP() []byte { } var file_api_proto_msgTypes = make([]protoimpl.MessageInfo, 14) -var file_api_proto_goTypes = []interface{}{ +var file_api_proto_goTypes = []any{ (*CreateResultRequest)(nil), // 0: tekton.results.v1alpha2.CreateResultRequest (*DeleteResultRequest)(nil), // 1: tekton.results.v1alpha2.DeleteResultRequest (*UpdateResultRequest)(nil), // 2: tekton.results.v1alpha2.UpdateResultRequest @@ -1202,7 +1202,7 @@ func file_api_proto_init() { } file_resources_proto_init() if !protoimpl.UnsafeEnabled { - file_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*CreateResultRequest); i { case 0: return &v.state @@ -1214,7 +1214,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*DeleteResultRequest); i { case 0: return &v.state @@ -1226,7 +1226,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*UpdateResultRequest); i { case 0: return &v.state @@ -1238,7 +1238,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[3].Exporter = func(v any, i int) any { switch v := v.(*GetResultRequest); i { case 0: return &v.state @@ -1250,7 +1250,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[4].Exporter = func(v any, i int) any { switch v := v.(*ListResultsRequest); i { case 0: return &v.state @@ -1262,7 +1262,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[5].Exporter = func(v any, i int) any { switch v := v.(*ListResultsResponse); i { case 0: return &v.state @@ -1274,7 +1274,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[6].Exporter = func(v any, i int) any { switch v := v.(*CreateRecordRequest); i { case 0: return &v.state @@ -1286,7 +1286,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[7].Exporter = func(v any, i int) any { switch v := v.(*DeleteRecordRequest); i { case 0: return &v.state @@ -1298,7 +1298,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[8].Exporter = func(v any, i int) any { switch v := v.(*UpdateRecordRequest); i { case 0: return &v.state @@ -1310,7 +1310,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[9].Exporter = func(v any, i int) any { switch v := v.(*GetRecordRequest); i { case 0: return &v.state @@ -1322,7 +1322,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[10].Exporter = func(v any, i int) any { switch v := v.(*ListRecordsRequest); i { case 0: return &v.state @@ -1334,7 +1334,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[11].Exporter = func(v any, i int) any { switch v := v.(*ListRecordsResponse); i { case 0: return &v.state @@ -1346,7 +1346,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[12].Exporter = func(v any, i int) any { switch v := v.(*GetLogRequest); i { case 0: return &v.state @@ -1358,7 +1358,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[13].Exporter = func(v any, i int) any { switch v := v.(*DeleteLogRequest); i { case 0: return &v.state diff --git a/proto/v1alpha2/results_go_proto/api_grpc.pb.go b/proto/v1alpha2/results_go_proto/api_grpc.pb.go index 2f67a6a7c..1cf0b3dd8 100644 --- a/proto/v1alpha2/results_go_proto/api_grpc.pb.go +++ b/proto/v1alpha2/results_go_proto/api_grpc.pb.go @@ -197,7 +197,7 @@ func RegisterResultsServer(s grpc.ServiceRegistrar, srv ResultsServer) { s.RegisterService(&Results_ServiceDesc, srv) } -func _Results_CreateResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Results_CreateResult_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { in := new(CreateResultRequest) if err := dec(in); err != nil { return nil, err @@ -209,13 +209,13 @@ func _Results_CreateResult_Handler(srv interface{}, ctx context.Context, dec fun Server: srv, FullMethod: "/tekton.results.v1alpha2.Results/CreateResult", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(ResultsServer).CreateResult(ctx, req.(*CreateResultRequest)) } return interceptor(ctx, in, info, handler) } -func _Results_UpdateResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Results_UpdateResult_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { in := new(UpdateResultRequest) if err := dec(in); err != nil { return nil, err @@ -227,13 +227,13 @@ func _Results_UpdateResult_Handler(srv interface{}, ctx context.Context, dec fun Server: srv, FullMethod: "/tekton.results.v1alpha2.Results/UpdateResult", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(ResultsServer).UpdateResult(ctx, req.(*UpdateResultRequest)) } return interceptor(ctx, in, info, handler) } -func _Results_GetResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Results_GetResult_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { in := new(GetResultRequest) if err := dec(in); err != nil { return nil, err @@ -245,13 +245,13 @@ func _Results_GetResult_Handler(srv interface{}, ctx context.Context, dec func(i Server: srv, FullMethod: "/tekton.results.v1alpha2.Results/GetResult", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(ResultsServer).GetResult(ctx, req.(*GetResultRequest)) } return interceptor(ctx, in, info, handler) } -func _Results_DeleteResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Results_DeleteResult_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { in := new(DeleteResultRequest) if err := dec(in); err != nil { return nil, err @@ -263,13 +263,13 @@ func _Results_DeleteResult_Handler(srv interface{}, ctx context.Context, dec fun Server: srv, FullMethod: "/tekton.results.v1alpha2.Results/DeleteResult", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(ResultsServer).DeleteResult(ctx, req.(*DeleteResultRequest)) } return interceptor(ctx, in, info, handler) } -func _Results_ListResults_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Results_ListResults_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { in := new(ListResultsRequest) if err := dec(in); err != nil { return nil, err @@ -281,13 +281,13 @@ func _Results_ListResults_Handler(srv interface{}, ctx context.Context, dec func Server: srv, FullMethod: "/tekton.results.v1alpha2.Results/ListResults", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(ResultsServer).ListResults(ctx, req.(*ListResultsRequest)) } return interceptor(ctx, in, info, handler) } -func _Results_CreateRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Results_CreateRecord_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { in := new(CreateRecordRequest) if err := dec(in); err != nil { return nil, err @@ -299,13 +299,13 @@ func _Results_CreateRecord_Handler(srv interface{}, ctx context.Context, dec fun Server: srv, FullMethod: "/tekton.results.v1alpha2.Results/CreateRecord", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(ResultsServer).CreateRecord(ctx, req.(*CreateRecordRequest)) } return interceptor(ctx, in, info, handler) } -func _Results_UpdateRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Results_UpdateRecord_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { in := new(UpdateRecordRequest) if err := dec(in); err != nil { return nil, err @@ -317,13 +317,13 @@ func _Results_UpdateRecord_Handler(srv interface{}, ctx context.Context, dec fun Server: srv, FullMethod: "/tekton.results.v1alpha2.Results/UpdateRecord", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(ResultsServer).UpdateRecord(ctx, req.(*UpdateRecordRequest)) } return interceptor(ctx, in, info, handler) } -func _Results_GetRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Results_GetRecord_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { in := new(GetRecordRequest) if err := dec(in); err != nil { return nil, err @@ -335,13 +335,13 @@ func _Results_GetRecord_Handler(srv interface{}, ctx context.Context, dec func(i Server: srv, FullMethod: "/tekton.results.v1alpha2.Results/GetRecord", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(ResultsServer).GetRecord(ctx, req.(*GetRecordRequest)) } return interceptor(ctx, in, info, handler) } -func _Results_ListRecords_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Results_ListRecords_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { in := new(ListRecordsRequest) if err := dec(in); err != nil { return nil, err @@ -353,13 +353,13 @@ func _Results_ListRecords_Handler(srv interface{}, ctx context.Context, dec func Server: srv, FullMethod: "/tekton.results.v1alpha2.Results/ListRecords", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(ResultsServer).ListRecords(ctx, req.(*ListRecordsRequest)) } return interceptor(ctx, in, info, handler) } -func _Results_DeleteRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Results_DeleteRecord_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { in := new(DeleteRecordRequest) if err := dec(in); err != nil { return nil, err @@ -371,7 +371,7 @@ func _Results_DeleteRecord_Handler(srv interface{}, ctx context.Context, dec fun Server: srv, FullMethod: "/tekton.results.v1alpha2.Results/DeleteRecord", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(ResultsServer).DeleteRecord(ctx, req.(*DeleteRecordRequest)) } return interceptor(ctx, in, info, handler) @@ -571,7 +571,7 @@ func RegisterLogsServer(s grpc.ServiceRegistrar, srv LogsServer) { s.RegisterService(&Logs_ServiceDesc, srv) } -func _Logs_GetLog_Handler(srv interface{}, stream grpc.ServerStream) error { +func _Logs_GetLog_Handler(srv any, stream grpc.ServerStream) error { m := new(GetLogRequest) if err := stream.RecvMsg(m); err != nil { return err @@ -592,7 +592,7 @@ func (x *logsGetLogServer) Send(m *Log) error { return x.ServerStream.SendMsg(m) } -func _Logs_ListLogs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Logs_ListLogs_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { in := new(ListRecordsRequest) if err := dec(in); err != nil { return nil, err @@ -604,13 +604,13 @@ func _Logs_ListLogs_Handler(srv interface{}, ctx context.Context, dec func(inter Server: srv, FullMethod: "/tekton.results.v1alpha2.Logs/ListLogs", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(LogsServer).ListLogs(ctx, req.(*ListRecordsRequest)) } return interceptor(ctx, in, info, handler) } -func _Logs_UpdateLog_Handler(srv interface{}, stream grpc.ServerStream) error { +func _Logs_UpdateLog_Handler(srv any, stream grpc.ServerStream) error { return srv.(LogsServer).UpdateLog(&logsUpdateLogServer{stream}) } @@ -636,7 +636,7 @@ func (x *logsUpdateLogServer) Recv() (*Log, error) { return m, nil } -func _Logs_DeleteLog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Logs_DeleteLog_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { in := new(DeleteLogRequest) if err := dec(in); err != nil { return nil, err @@ -648,7 +648,7 @@ func _Logs_DeleteLog_Handler(srv interface{}, ctx context.Context, dec func(inte Server: srv, FullMethod: "/tekton.results.v1alpha2.Logs/DeleteLog", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(LogsServer).DeleteLog(ctx, req.(*DeleteLogRequest)) } return interceptor(ctx, in, info, handler) diff --git a/proto/v1alpha2/results_go_proto/resources.pb.go b/proto/v1alpha2/results_go_proto/resources.pb.go index a50dafa36..83e542cb3 100644 --- a/proto/v1alpha2/results_go_proto/resources.pb.go +++ b/proto/v1alpha2/results_go_proto/resources.pb.go @@ -793,7 +793,7 @@ func file_resources_proto_rawDescGZIP() []byte { var file_resources_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_resources_proto_msgTypes = make([]protoimpl.MessageInfo, 8) -var file_resources_proto_goTypes = []interface{}{ +var file_resources_proto_goTypes = []any{ (RecordSummary_Status)(0), // 0: tekton.results.v1alpha2.RecordSummary.Status (*Result)(nil), // 1: tekton.results.v1alpha2.Result (*Record)(nil), // 2: tekton.results.v1alpha2.Record @@ -834,7 +834,7 @@ func file_resources_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_resources_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_resources_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*Result); i { case 0: return &v.state @@ -846,7 +846,7 @@ func file_resources_proto_init() { return nil } } - file_resources_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_resources_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*Record); i { case 0: return &v.state @@ -858,7 +858,7 @@ func file_resources_proto_init() { return nil } } - file_resources_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_resources_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*Any); i { case 0: return &v.state @@ -870,7 +870,7 @@ func file_resources_proto_init() { return nil } } - file_resources_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_resources_proto_msgTypes[3].Exporter = func(v any, i int) any { switch v := v.(*RecordSummary); i { case 0: return &v.state @@ -882,7 +882,7 @@ func file_resources_proto_init() { return nil } } - file_resources_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_resources_proto_msgTypes[4].Exporter = func(v any, i int) any { switch v := v.(*Log); i { case 0: return &v.state @@ -894,7 +894,7 @@ func file_resources_proto_init() { return nil } } - file_resources_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_resources_proto_msgTypes[5].Exporter = func(v any, i int) any { switch v := v.(*LogSummary); i { case 0: return &v.state diff --git a/tools/postgres-migrate/main.go b/tools/postgres-migrate/main.go index 9e41591b3..acc5d7fc0 100644 --- a/tools/postgres-migrate/main.go +++ b/tools/postgres-migrate/main.go @@ -183,7 +183,7 @@ func convertRecord(r *db.Record) error { // for more details). We handle this by stripping out the problematic fields, // converting the type, then resetting the fields later. var gen, observedGen int64 - var wantType interface{} + var wantType any switch m := out.(type) { case *pb.TaskRun: r.Type = "tekton.dev/v1beta1.TaskRun" @@ -203,7 +203,7 @@ func convertRecord(r *db.Record) error { m.Status.ObservedGeneration = 0 default: r.Type = any.TypeUrl - wantType = map[string]interface{}{} + wantType = map[string]any{} } // Sanity check that the converted JSON can be safely marshalled into diff --git a/tools/postgres-migrate/main_test.go b/tools/postgres-migrate/main_test.go index 89827ae7b..2c279b3b1 100644 --- a/tools/postgres-migrate/main_test.go +++ b/tools/postgres-migrate/main_test.go @@ -314,7 +314,7 @@ func TestMigrate(t *testing.T) { }) } -func clearDB(db *gorm.DB, types ...interface{}) error { +func clearDB(db *gorm.DB, types ...any) error { for _, t := range types { out := db.Session(&gorm.Session{AllowGlobalUpdate: true}).Delete(t) if out.Error != nil { @@ -342,8 +342,8 @@ func protodata(t *testing.T, m proto.Message) []byte { return b } -func jsondata(t *testing.T, i interface{}) []byte { - b, err := json.Marshal(i) +func jsondata(t *testing.T, v any) []byte { + b, err := json.Marshal(v) if err != nil { t.Fatalf("error marshinalling json: %v", err) }