Standard library / net/textproto

textproto.MIMEHeader.Del()

Remove all values for a canonicalized key. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
func (h MIMEHeader) Del(key string)

Parameters & Attributes

NameTypeDescription
keystringMIME header field name.

Working Example

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