I would like to get the URL and convert it to string. I have to following code:
func getURL(w http.ResponseWriter, r *http.Request) {
var url string = r.URL
}
I get this:
"cannot convert r.URL (type *url.URL) to type string"
This is working well:
fmt.Fprint(w,r.URL)
But I would like to use it, not just print it.
What should I do?