Golang text/template.URLQueryEscaper() function example
package text/template
Golang text/template.URLQueryEscaper() function usage example
package main
import (
"fmt"
"text/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
+21.8k Golang : Convert string slice to struct and access with reflect example
+27.5k Golang : Convert integer to binary, octal, hexadecimal and back to integer
+22k Fix "Failed to start php5-fpm.service: Unit php5-fpm.service is masked."
+9.2k Golang : Create and shuffle deck of cards example
+7.5k Golang : How to stop user from directly running an executable file?
+6.9k Fix sudo yum hang problem with no output or error messages
+5.8k Golang : Launching your executable inside a console under Linux
+12.3k Golang : Flush and close file created by os.Create and bufio.NewWriter example
+8.8k Golang : On lambda, anonymous, inline functions and function literals
+18.6k Golang : Get download file size
+48.1k Golang : How to convert JSON string to map and slice