Standard library / net/textproto

textproto.Error.Error()

Format numeric status and message for error reporting. Expected stdout: '550 unavailable\n'.

Formal Syntax & Structure

go syntaxgo
func (e *Error) Error() string

Return Value

string

Formatted numeric error message.

Working Example

Example Snippetgo
package main
import (  "fmt"  "net/textproto")
func main() { e := &textproto.Error{Code: 550, Msg: "unavailable"}; 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