Skip to content

Instantly share code, notes, and snippets.

@KentaKudo
Created January 21, 2019 19:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KentaKudo/a03da1a4e0180f07fae9afed686104e9 to your computer and use it in GitHub Desktop.
Save KentaKudo/a03da1a4e0180f07fae9afed686104e9 to your computer and use it in GitHub Desktop.
Go Code Snippet: URL.Query()
func handler(w http.ResponseWriter, r *http.Request) {
queries := r.URL.Query() // Values = map[string][]string
for key, values := range queries {
for _, v := range values {
fmt.Fprintf(w, "key: %s, value: %s\n", key, v)
}
}
}
@KentaKudo
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment