Standard library / net/url

url.Userinfo

Immutable user information, constructed with User or UserPassword. Expected stdout: 'demo\n'.

Formal Syntax & Structure

go syntaxgo
type Userinfo struct {}

Working Example

Example Snippetgo
package main
import (  "fmt"  "net/url")
func main() { u := url.User("demo"); fmt.Println(u.Username()) }
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)  }}
Go Reference