Standard library / net/url
url.Userinfo.String()
Return escaped user information; may contain a password, so do not log it. Expected stdout: 'a%20b\n'.
Formal Syntax & Structure
go syntaxgo
func (u *Userinfo) String() stringReturn Value
string
Operation result; check errors and validity indicators when returned.
Working Example
Example Snippetgo
package main
import ( "fmt" "net/url")
func main() { fmt.Println(url.User("a b").String()) }
func must[T any](v T, e error) T { if e != nil { panic(e) } return v}func check(e error) { if e != nil { panic(e) }}