Skip to content

Commit 3881d74

Browse files
committed
remove strPtr and use ptr.To as we already use ptr.Deref
1 parent 75ea9bf commit 3881d74

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

fn_test.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"github.com/upbound/function-msgraph/input/v1beta1"
1111
"google.golang.org/protobuf/testing/protocmp"
1212
"google.golang.org/protobuf/types/known/durationpb"
13+
"k8s.io/utils/ptr"
1314

1415
"github.com/crossplane/crossplane-runtime/pkg/errors"
1516
"github.com/crossplane/crossplane-runtime/pkg/logging"
@@ -26,10 +27,6 @@ func (m *MockGraphQuery) graphQuery(ctx context.Context, azureCreds map[string]s
2627
return m.GraphQueryFunc(ctx, azureCreds, in)
2728
}
2829

29-
func strPtr(s string) *string {
30-
return &s
31-
}
32-
3330
// TestResolveGroupsRef tests the functionality of resolving groupsRef from context, status, or spec
3431
func TestResolveGroupsRef(t *testing.T) {
3532
var (
@@ -2312,7 +2309,7 @@ func TestRunFunction(t *testing.T) {
23122309
Conditions: []*fnv1.Condition{
23132310
{
23142311
Type: "FunctionSkip",
2315-
Message: strPtr("Target already has data, skipped query to avoid throttling"),
2312+
Message: ptr.To("Target already has data, skipped query to avoid throttling"),
23162313
Status: fnv1.Status_STATUS_CONDITION_TRUE,
23172314
Reason: "SkippedQuery",
23182315
Target: fnv1.Target_TARGET_COMPOSITE_AND_CLAIM.Enum(),

0 commit comments

Comments
 (0)