FromURLQuery generates a new Obj by parsing the specified query. For queries with multiple values, the first value is selected.
(query string)
| 188 | // |
| 189 | // For queries with multiple values, the first value is selected. |
| 190 | func FromURLQuery(query string) (Map, error) { |
| 191 | vals, err := url.ParseQuery(query) |
| 192 | if err != nil { |
| 193 | return nil, err |
| 194 | } |
| 195 | m := Map{} |
| 196 | for k, vals := range vals { |
| 197 | m[k] = vals[0] |
| 198 | } |
| 199 | return m, nil |
| 200 | } |
| 201 | |
| 202 | // MustFromURLQuery generates a new Obj by parsing the specified |
| 203 | // query. |
no outgoing calls
searching dependent graphs…