From c47194b0897b2565b6d4a2bf6e7b95284de3f206 Mon Sep 17 00:00:00 2001 From: Bryce Lampe Date: Mon, 4 Dec 2023 11:08:07 -0800 Subject: [PATCH] Fix lint --- pf/internal/defaults/defaults_test.go | 6 +++--- pkg/tfbridge/names.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pf/internal/defaults/defaults_test.go b/pf/internal/defaults/defaults_test.go index a2cfd0822..c900e389d 100644 --- a/pf/internal/defaults/defaults_test.go +++ b/pf/internal/defaults/defaults_test.go @@ -24,7 +24,7 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/common/resource" "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge" - "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim" + shim "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim" "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/schema" ) @@ -62,7 +62,7 @@ func TestApplyDefaultInfoValues(t *testing.T) { } testFrom := func(res *tfbridge.PulumiResource) (interface{}, error) { - n := string(res.URN.Name()) + "-" + n := res.URN.Name() + "-" a := []rune("12345") unique, err := resource.NewUniqueName(res.Seed, n, 3, 12, a) return resource.NewStringProperty(unique), err @@ -74,7 +74,7 @@ func TestApplyDefaultInfoValues(t *testing.T) { ) func(context.Context, tfbridge.ComputeDefaultOptions) (interface{}, error) { return func(_ context.Context, opts tfbridge.ComputeDefaultOptions) (interface{}, error) { require.Equal(t, expectPriorValue, opts.PriorValue) - n := string(opts.URN.Name()) + "-" + n := opts.URN.Name() + "-" a := []rune("12345") unique, err := resource.NewUniqueName(opts.Seed, n, 3, 12, a) return resource.NewStringProperty(unique), err diff --git a/pkg/tfbridge/names.go b/pkg/tfbridge/names.go index 8597aa27a..81b32f09e 100644 --- a/pkg/tfbridge/names.go +++ b/pkg/tfbridge/names.go @@ -364,7 +364,7 @@ func ComputeAutoNameDefault( } // Take the URN name part, transform it if required, and then append some unique characters if requested. - vs := string(defaultOptions.URN.Name()) + vs := defaultOptions.URN.Name() if options.Transform != nil { vs = options.Transform(vs) }