diff --git a/default.go b/default.go index 0c65e76..7fa1dab 100644 --- a/default.go +++ b/default.go @@ -9,6 +9,10 @@ import ( ) func setDefaultValue(v reflect.Value) error { + if v.Type().Kind() == reflect.Ptr { + v = v.Elem() + } + for i := 0; i < v.Type().NumField(); i++ { f := v.Type().Field(i) if !f.IsExported() {