Standard library / net/textproto

textproto.ProtocolError.Error()

Return the protocol error text. Expected stdout: 'bad response\n'.

Formal Syntax & Structure

go syntaxgo
func (p ProtocolError) Error() string

Return Value

string

Protocol error text.

Working Example

Example Snippetgo
package main
import (  "fmt"  "net/textproto")
func main() { e := textproto.ProtocolError("bad response"); fmt.Println(e.Error()) }
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