CanonicalMIMEHeaderKey
HTTP, SMTP, news all canonicalize header names the same way. http.Header is really a textproto.MIMEHeader.
textproto.CanonicalMIMEHeaderKey("content-type") // "Content-Type"
net/textprotoImplements generic text protocols in the SMTP/HTTP/NNTP style: numbered command/response, MIME headers, pipelining.
You're writing a client or server for a text protocol that's not HTTP. textproto handles the fiddly parts: canonicalized header names, reading folded header lines, sending/reading responses with continuation lines.
HTTP, SMTP, news all canonicalize header names the same way. http.Header is really a textproto.MIMEHeader.
textproto.CanonicalMIMEHeaderKey("content-type") // "Content-Type"