From e209ff6afb8d8139d7b0b6f2cb26dec50c44a6cd Mon Sep 17 00:00:00 2001 From: Ilya Ozherelyev Date: Mon, 11 Nov 2024 14:04:58 +0100 Subject: [PATCH] add a nil case to ValueFromPtr --- internal/common/convert_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/common/convert_test.go b/internal/common/convert_test.go index a88b4d020..94e6fa3bf 100644 --- a/internal/common/convert_test.go +++ b/internal/common/convert_test.go @@ -64,6 +64,7 @@ func TestValueFromPtr(t *testing.T) { assert.Equal(t, 1.1, ValueFromPtr(PtrOf(1.1))) assert.Equal(t, true, ValueFromPtr(PtrOf(true))) assert.Equal(t, []string{"a"}, ValueFromPtr(PtrOf([]string{"a"}))) + assert.Equal(t, "" /* default value */, ValueFromPtr((*string)(nil))) } func TestZero(t *testing.T) {