Golang html/template.URLEscaper function example
package html/template
URLQueryEscaper returns the escaped value of the textual representation of its arguments in a form suitable for embedding in a URL query.
Golang html/template.URLEscaper function usage example
package main
import (
"fmt"
"html/template"
)
func main() {
search := "Zip Unzip"
finalURL := "http://go-search.org/search?q=" + template.URLQueryEscaper(search)
fmt.Println(finalURL)
}
Output :
http://go-search.org/search?q=Zip+Unzip
Reference :
Advertisement
Something interesting
Tutorials
+8.1k Golang : How To Use Panic and Recover
+12.3k Golang : How to check if a string starts or ends with certain characters or words?
+15.7k Golang : Intercept Ctrl-C interrupt or kill signal and determine the signal type
+13.8k Golang : Gin framework accept query string by post request example
+22.6k Generate checksum for a file in Go
+33.6k Golang : How to check if slice or array is empty?
+7.1k Golang : Get environment variable
+14.4k Golang : Recombine chunked files example
+20.5k nginx: [emerg] unknown directive "passenger_enabled"
+13.6k Golang : Set image canvas or background to transparent
+5.2k Responsive Google Adsense
+10k Golang : Convert octal value to string to deal with leading zero problem