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
+12.9k Golang : Convert IPv4 address to packed 32-bit binary format
+8.4k Your page has meta tags in the body instead of the head
+8.6k Golang : Another camera capture GUI application with GTK and OpenCV
+31.9k Golang : Convert an image file to []byte
+19.8k Golang : Append content to a file
+16.6k Golang : Delete files by extension
+10.6k Golang : How to delete element(data) from map ?
+6.1k Golang : Dealing with backquote
+8.2k Golang : Metaprogramming example of wrapping a function
+8.1k Golang : Append and add item in slice
+8.2k Golang : Find relative luminance or color brightness