Standard library / net/textproto

textproto.MIMEHeader

Map canonical MIME header keys to lists of values. Initialize before writing; callers must synchronize concurrent mutation. Expected stdout: '[a b]\n'.

Formal Syntax & Structure

go syntaxgo
type MIMEHeader map[string][]string

Working Example

Example Snippetgo
package main
import (  "fmt"  "net/textproto")
func main() {  h := textproto.MIMEHeader{}  h.Add("X-Demo", "a")  h.Add("x-demo", "b")  fmt.Println(h.Values("X-DEMO"))}
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