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
+6k PHP : How to check if an array is empty ?
+31.6k Golang : Get local IP and MAC address
+11.7k Golang : Secure file deletion with wipe example
+24.5k Golang : Time slice or date sort and reverse sort example
+10.8k PHP : Convert(cast) bigInt to string
+15k Golang : package is not in GOROOT during compilation
+9.8k Golang : Qt get screen resolution and display on center example
+33.8k Golang : convert(cast) bytes to string
+6.3k Unix/Linux : Use netstat to find out IP addresses served by your website server
+26.1k Mac/Linux and Golang : Fix bind: address already in use error
+6.8k Swift : substringWithRange() function example
+7.9k Golang : Ways to recover memory during run time.