diff --git a/gapr.go b/gapr.go index 550810c..e68e52e 100644 --- a/gapr.go +++ b/gapr.go @@ -30,6 +30,7 @@ func (g *Gapr) Map(input any) (any, error) { if t.Kind() == reflect.Pointer { t = t.Elem() + v = v.Elem() } if !canMap(t) { diff --git a/gapr_test.go b/gapr_test.go index c81c9e4..623eeab 100644 --- a/gapr_test.go +++ b/gapr_test.go @@ -30,6 +30,20 @@ func TestGapr_Map(t *testing.T) { want: nil, wantErr: false, }, + { + name: "Test simple struct pointer", + args: args{ + input: &struct { + GivenName string + Surname string + }{ + GivenName: "Ted", + Surname: "Tester", + }, + }, + want: nil, + wantErr: false, + }, { name: "Test nested struct", args: args{