reflect: make sure pointerTo() works for named types

This commit is contained in:
Damian Gryski
2023-03-11 23:00:09 -08:00
committed by Ron Evans
parent 876f08979f
commit 229f479a7d
2 changed files with 12 additions and 0 deletions
+8
View File
@@ -275,6 +275,14 @@ func TestNamedTypes(t *testing.T) {
t.Errorf("Type.String(base64.Encoding{})=%v, want %v", got, want)
}
type Repository struct {
RoleName *string `json:"role_name,omitempty"`
}
var repo *Repository
v := ValueOf(&repo).Elem()
n := New(v.Type().Elem())
v.Set(n)
}
func TestStruct(t *testing.T) {