libgo: update to Go1.14beta1
[platform/upstream/gcc.git] / libgo / go / net / textproto / header.go
index ed096d9..a58df7a 100644 (file)
@@ -26,8 +26,7 @@ func (h MIMEHeader) Set(key, value string) {
 // It is case insensitive; CanonicalMIMEHeaderKey is used
 // to canonicalize the provided key.
 // If there are no values associated with the key, Get returns "".
-// To access multiple values of a key, or to use non-canonical keys,
-// access the map directly.
+// To use non-canonical keys, access the map directly.
 func (h MIMEHeader) Get(key string) string {
        if h == nil {
                return ""
@@ -39,6 +38,18 @@ func (h MIMEHeader) Get(key string) string {
        return v[0]
 }
 
+// Values returns all values associated with the given key.
+// It is case insensitive; CanonicalMIMEHeaderKey is
+// used to canonicalize the provided key. To use non-canonical
+// keys, access the map directly.
+// The returned slice is not a copy.
+func (h MIMEHeader) Values(key string) []string {
+       if h == nil {
+               return nil
+       }
+       return h[CanonicalMIMEHeaderKey(key)]
+}
+
 // Del deletes the values associated with key.
 func (h MIMEHeader) Del(key string) {
        delete(h, CanonicalMIMEHeaderKey(key))