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
+10.1k Golang : Check a web page existence with HEAD request example
+16.5k Golang : Get IP addresses of a domain name
+22.1k Golang : Match strings by wildcard patterns with filepath.Match() function
+17.2k Google Chrome : Your connection to website is encrypted with obsolete cryptography
+14.5k Golang : How to determine if user agent is a mobile device example
+32.1k Golang : Validate email address with regular expression
+15k Golang : How do I get the local IP (non-loopback) address ?
+27.6k PHP : Convert(cast) string to bigInt
+16.9k Golang : How to generate QR codes?
+48.5k Golang : Upload file from web browser to server
+7.9k Golang : Trim everything onward after a word