diff --git a/internal/util.go b/internal/util.go index c831dc659..641309725 100644 --- a/internal/util.go +++ b/internal/util.go @@ -25,12 +25,12 @@ func MakeSliceNextElemFunc(v reflect.Value) func() reflect.Value { if elem.IsNil() { elem.Set(reflect.New(elemType)) } - return elem.Elem() + return elem } elem := reflect.New(elemType) v.Set(reflect.Append(v, elem)) - return elem.Elem() + return elem } } diff --git a/util.go b/util.go index ce56be805..873ba2816 100644 --- a/util.go +++ b/util.go @@ -89,12 +89,12 @@ func makeSliceNextElemFunc(v reflect.Value) func() reflect.Value { if elem.IsNil() { elem.Set(reflect.New(elemType)) } - return elem.Elem() + return elem } elem := reflect.New(elemType) v.Set(reflect.Append(v, elem)) - return elem.Elem() + return elem } }