diff --git a/internal/common/pointers.go b/internal/common/pointers.go index 2ba12ad12..c11ea4d11 100644 --- a/internal/common/pointers.go +++ b/internal/common/pointers.go @@ -11,3 +11,7 @@ func Uint64ToPtr(x uint64) *uint64 { func BoolToPtr(x bool) *bool { return &x } + +func StringToPtr(x string) *string { + return &x +} diff --git a/internal/common/pointers_test.go b/internal/common/pointers_test.go index 01c1d0cd8..c0af2d347 100644 --- a/internal/common/pointers_test.go +++ b/internal/common/pointers_test.go @@ -17,3 +17,15 @@ func TestBoolToPtr(t *testing.T) { got := BoolToPtr(value) assert.Equal(t, value, *got) } + +func TestUint64ToPtr(t *testing.T) { + var value uint64 = 1 + got := Uint64ToPtr(value) + assert.Equal(t, value, *got) +} + +func TestStringToPtr(t *testing.T) { + var value string = "the-greatest-test-value" + got := StringToPtr(value) + assert.Equal(t, value, *got) +}