Standard library / net/http
http.StatusUnauthorized
HTTP status 401. Valid authentication credentials are required; a challenge is expected. Expected stdout: '401\n'.
Formal Syntax & Structure
go syntaxgo
const StatusUnauthorized = 401Working Example
Example Snippetgo
package main
import ( "fmt" "net/http")
func main() { fmt.Println(http.StatusUnauthorized) }
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) }}