@@ -19,23 +19,27 @@ type Header map[string][]string
19
19
20
20
// Add adds the key, value pair to the header.
21
21
// It appends to any existing values associated with key.
22
+ // The key is case insensitive; it is canonicalized by
23
+ // textproto.CanonicalMIMEHeaderKey.
22
24
func (h Header ) Add (key , value string ) {
23
25
textproto .MIMEHeader (h ).Add (key , value )
24
26
}
25
27
26
- // Set sets the header entries associated with key to
27
- // the single element value. It replaces any existing
28
- // values associated with key.
28
+ // Set sets the header entries associated with key to the
29
+ // single element value. It replaces any existing values
30
+ // associated with key. The key is case insensitive; it is
31
+ // canonicalized by textproto.CanonicalMIMEHeaderKey.
32
+ // To use non-canonical keys, assign to the map directly.
29
33
func (h Header ) Set (key , value string ) {
30
34
textproto .MIMEHeader (h ).Set (key , value )
31
35
}
32
36
33
- // Get gets the first value associated with the given key.
34
- // It is case insensitive; textproto.CanonicalMIMEHeaderKey is used
35
- // to canonicalize the provided key.
36
- // If there are no values associated with the key, Get returns "".
37
- // To access multiple values of a key, or to use non-canonical keys,
38
- // access the map directly.
37
+ // Get gets the first value associated with the given key. If
38
+ // there are no values associated with the key, Get returns "".
39
+ // It is case insensitive; textproto.CanonicalMIMEHeaderKey is
40
+ // used to canonicalize the provided key. To access multiple
41
+ // values of a key, or to use non-canonical keys, access the
42
+ // map directly.
39
43
func (h Header ) Get (key string ) string {
40
44
return textproto .MIMEHeader (h ).Get (key )
41
45
}
@@ -49,6 +53,8 @@ func (h Header) get(key string) string {
49
53
}
50
54
51
55
// Del deletes the values associated with key.
56
+ // The key is case insensitive; it is canonicalized by
57
+ // textproto.CanonicalMIMEHeaderKey.
52
58
func (h Header ) Del (key string ) {
53
59
textproto .MIMEHeader (h ).Del (key )
54
60
}
0 commit comments