Standard library / net/textproto
textproto.ProtocolError
String-backed error type describing a protocol violation. Expected stdout: 'bad response\n'.
Formal Syntax & Structure
go syntaxgo
type ProtocolError stringWorking Example
Example Snippetgo
package main
import ( "fmt" "net/textproto")
func main() { var e error = textproto.ProtocolError("bad response"); fmt.Println(e) }
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) }}