use reflect.Ptr not reflect.Pointer since the latter was added in Go 1.18

This commit is contained in:
Alex Flint 2022-10-29 15:21:21 -04:00
parent 3d95a706a6
commit 763072452f
1 changed files with 1 additions and 1 deletions

View File

@ -416,7 +416,7 @@ func cmdFromStruct(name string, dest path, t reflect.Type) (*command, error) {
// parse the default value
spec.defaultString = defaultString
if field.Type.Kind() == reflect.Pointer {
if field.Type.Kind() == reflect.Ptr {
// here we have a field of type *T and we create a new T, no need to dereference
// in order for the value to be settable
spec.defaultValue = reflect.New(field.Type.Elem())