MCPcopy Create free account
hub / github.com/stretchr/objx / FromURLQuery

Function FromURLQuery

map.go:190–200  ·  view source on GitHub ↗

FromURLQuery generates a new Obj by parsing the specified query. For queries with multiple values, the first value is selected.

(query string)

Source from the content-addressed store, hash-verified

188//
189// For queries with multiple values, the first value is selected.
190func 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.

Callers 3

TestMapFromURLQueryFunction · 0.92
MustFromURLQueryFunction · 0.85

Calls

no outgoing calls

Tested by 2

TestMapFromURLQueryFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…