Documentation ¶
Overview ¶
Package queryparam provides utilities for efficiently working with query parameters in URLs. It focuses on zero allocation URL query parameter lookups.
func handler(w http.ResponseWriter, r *http.Request) { // Get the value of the `key` query parameter. value := queryparam.Get(r.URL.RawQuery, "key") }
Note that this method does not support multiple values for the same key, so using `val=1,2,3` is preferable to `val=1&val=2&val=3`.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
Get a query param by name without any dynamic allocations. For small numbers of query params, it is faster to call this method multiple times than to use `url.ParseQuery` and then call `Get` on the resulting `url.Values`. This method does not support multiple values for the same key, so using `val=1,2,3` is preferable to `val=1&val=2&val=3`.
Types ¶
This section is empty.