Skip to content

url-query-copy-mutation

Detect mutations of the temporary copy returned by URL.Query.

Updated View as Markdown

Default severity: warning

URL.Query parses RawQuery and returns a new Values map. Mutating that temporary map does not update the URL unless the encoded result is assigned back to RawQuery.

Bad

address.Query().Set(key, value)

Good

values := address.Query(); values.Set(key, value); address.RawQuery = values.Encode()
Navigation

Type to search…

↑↓ navigate↵ selectEsc close