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
+9.3k Golang : Generate random Chinese, Japanese, Korean and other runes
+17.6k Golang : Parse date string and convert to dd-mm-yyyy format
+12k Golang : Clean formatting/indenting or pretty print JSON result
+29.4k Golang : JQuery AJAX post data to server and send data back to client example
+20.2k Golang : How to get struct tag and use field name to retrieve data?
+13.3k CodeIgniter : "Fatal error: Cannot use object of type stdClass as array" message
+3.6k Java : Get FX sentiment from website example
+31.7k Golang : How to convert(cast) string to IP address?
+7k Golang : constant 20013 overflows byte error message
+19.5k Golang : Example for DSA(Digital Signature Algorithm) package functions
+9.6k Javascript : Read/parse JSON data from HTTP response
+9.5k Golang : Detect Pascal, Kebab, Screaming Snake and Camel cases