diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0f019a8..971ef88 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,7 @@ jobs: uses: golangci/golangci-lint-action@v9 with: # renovate: datasource=go depName=github.com/golangci/golangci-lint - version: 'v2.11.4' + version: 'v2.12.2' unit-test: runs-on: ubuntu-24.04 diff --git a/fn_test.go b/fn_test.go index 5d8e2cf..dbab591 100644 --- a/fn_test.go +++ b/fn_test.go @@ -26,6 +26,8 @@ func TestRunFunction(t *testing.T) { err error } + const tagHello = "hello" + cases := map[string]struct { reason string args args @@ -35,7 +37,7 @@ func TestRunFunction(t *testing.T) { reason: "The Function requires more external resources", args: args{ req: &fnv1.RunFunctionRequest{ - Meta: &fnv1.RequestMeta{Tag: "hello"}, + Meta: &fnv1.RequestMeta{Tag: tagHello}, Input: resource.MustStructJSON(`{ "apiVersion": "s3-user-arn.fn.crossplane.io/v1alpha1", "kind": "Input" @@ -74,7 +76,7 @@ func TestRunFunction(t *testing.T) { }, want: want{ rsp: &fnv1.RunFunctionResponse{ - Meta: &fnv1.ResponseMeta{Tag: "hello", Ttl: durationpb.New(response.DefaultTTL)}, + Meta: &fnv1.ResponseMeta{Tag: tagHello, Ttl: durationpb.New(response.DefaultTTL)}, Context: resource.MustStructJSON(`{ "apiextensions.crossplane.io/environment": { "tenantName": "tenant" @@ -104,7 +106,7 @@ func TestRunFunction(t *testing.T) { reason: "The Function should return a successful result if sufficient resources are provided", args: args{ req: &fnv1.RunFunctionRequest{ - Meta: &fnv1.RequestMeta{Tag: "hello"}, + Meta: &fnv1.RequestMeta{Tag: tagHello}, Input: resource.MustStructJSON(`{ "apiVersion": "s3-user-arn.fn.crossplane.io/v1alpha1", "kind": "Input" @@ -163,7 +165,7 @@ func TestRunFunction(t *testing.T) { }, want: want{ rsp: &fnv1.RunFunctionResponse{ - Meta: &fnv1.ResponseMeta{Tag: "hello", Ttl: durationpb.New(response.DefaultTTL)}, + Meta: &fnv1.ResponseMeta{Tag: tagHello, Ttl: durationpb.New(response.DefaultTTL)}, Context: resource.MustStructJSON(`{ "apiextensions.crossplane.io/environment": { "tenantName": "tenant" @@ -209,7 +211,7 @@ func TestRunFunction(t *testing.T) { reason: "The Function should return a successful result if sufficient resources are provided", args: args{ req: &fnv1.RunFunctionRequest{ - Meta: &fnv1.RequestMeta{Tag: "hello"}, + Meta: &fnv1.RequestMeta{Tag: tagHello}, Input: resource.MustStructJSON(`{ "apiVersion": "s3-user-arn.fn.crossplane.io/v1alpha1", "kind": "Input" @@ -270,7 +272,7 @@ func TestRunFunction(t *testing.T) { }, want: want{ rsp: &fnv1.RunFunctionResponse{ - Meta: &fnv1.ResponseMeta{Tag: "hello", Ttl: durationpb.New(response.DefaultTTL)}, + Meta: &fnv1.ResponseMeta{Tag: tagHello, Ttl: durationpb.New(response.DefaultTTL)}, Context: resource.MustStructJSON(`{ "apiextensions.crossplane.io/environment": { "tenantName": "tenant"