This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // StructToURLValues converts a struct into url.Values using the field tag (tagname param) value as the encoded field name. | |
| func StructToURLValues(i interface{}, tagname string) url.Values { | |
| values := url.Values{} | |
| if i == nil { | |
| return values | |
| } | |
| iVal := reflect.ValueOf(i).Elem() | |
| buildURLValues(iVal, values, tagname) | |
| return values |