Standard library / html/template

html/template.URLQueryEscaper()

Formats and URL-query-escapes arguments; not validation of a complete URL. Expected stdout: 'a+b%26c\n'.

Formal Syntax & Structure

go syntaxgo
func URLQueryEscaper(args ...any) string

Parameters & Attributes

NameTypeDescription
args...anyValues formatted before escaping.

Return Value

string

Formats and URL-query-escapes arguments; not validation of a complete URL.

Working Example

Example Snippetgo
package main
import (  "fmt"  "html/template")
func main() { fmt.Println(template.URLQueryEscaper("a b&c")) }
Go Reference