Standard library / net/mail
mail.ErrHeaderNotPresent
Sentinel for missing headers in helpers such as Header.Date and Header.AddressList. Expected stdout: 'true\n'.
Formal Syntax & Structure
go syntaxgo
var ErrHeaderNotPresent errorWorking Example
Example Snippetgo
package main
import ( "errors" "fmt" "net/mail")
func main() { h := mail.Header{} _, e := h.Date() fmt.Println(errors.Is(e, mail.ErrHeaderNotPresent))}
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) }}