2808 explained code solutions for 75 technologies


golangHow to parse query string params


package main
import "net/url"

func main() {
  url, _ := url.Parse("https://test.com/?a=1&b=hi")
  a := url.Query()["a"]
  b := url.Query()["b"]
}ctrl + c
package main

default package declaration

func main() {

declare main function that will be launched automatically

url.Parse(

parses given URL into url object

url.Query()

get query string as map