We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0d72f00 commit e8fedecCopy full SHA for e8fedec
query/encode.go
@@ -82,8 +82,13 @@ func Values(v interface{}) (url.Values, error) {
82
values := &url.Values{}
83
84
val := reflect.ValueOf(v)
85
+ if val.Kind() == reflect.Ptr && val.IsNil() {
86
+ return *values, nil
87
+ }
88
+
89
+ val = reflect.Indirect(val)
90
if val.Kind() != reflect.Struct {
- return nil, fmt.Errorf("query: Values() expects struct input")
91
+ return nil, fmt.Errorf("query: Values() expects struct input. Got %v", val.Kind())
92
}
93
94
reflectValue(values, val)
0 commit comments