The query string carries a handler's inputs as key=value pairs. Today you decode it into a lookup so a handler can read parameters like q and page.
Parse a raw query string into named parameters a handler can read.
Back in the parsing chapter you split the raw query string off the target but left
it as one opaque string. Handlers need it broken up: a query like q=cats&n=2 is
a set of key=value pairs joined by &, and a search handler wants q and n
individually.
Split on &, then split each pair on its first =. A pair with no = (flag)
has an empty value; an absent key reads back empty, mirroring how Headers.Get
behaves. Now a handler can offer real behavior — search, pagination, filtering —
driven by the URL.
params := map[string]string{}for _, pair := range strings.Split(rawQuery, "&") {if pair == "" { continue }k, v, _ := strings.Cut(pair, "=") // "a=b" -> "a","b"; "a" -> "a",""params[k] = v}