[Golang] Remove Query String From URL
Remove query string from URL in Golang.
import "net/url"
func StripQueryString(inputUrl string) string {
u, err := url.Parse(inputUrl)
if err != nil {
panic(err)
}
u.RawQuery = ""
return u.String()
}
Tested on: Ubuntu Linux 15.10, Go 1.6.
References:
[1] | go url remove query |
[2] | url - The Go Programming Language |