aboutsummaryrefslogtreecommitdiff
path: root/vendor/google.golang.org/grpc/metadata
diff options
context:
space:
mode:
authorNiall Sheridan <nsheridan@gmail.com>2016-10-08 16:02:50 -0500
committerNiall Sheridan <nsheridan@gmail.com>2016-10-08 16:02:50 -0500
commitbaf7141d1dd0f99d561a2197a909c66dd389809d (patch)
tree92c176f713b0b28893344261b1e567db5e30ba79 /vendor/google.golang.org/grpc/metadata
parent696aebffe56853345d679d4d2b3051236423c6db (diff)
Update dependencies
Diffstat (limited to 'vendor/google.golang.org/grpc/metadata')
-rw-r--r--vendor/google.golang.org/grpc/metadata/metadata.go13
1 files changed, 10 insertions, 3 deletions
diff --git a/vendor/google.golang.org/grpc/metadata/metadata.go b/vendor/google.golang.org/grpc/metadata/metadata.go
index 954c0f7..3c0ca7a 100644
--- a/vendor/google.golang.org/grpc/metadata/metadata.go
+++ b/vendor/google.golang.org/grpc/metadata/metadata.go
@@ -117,10 +117,17 @@ func (md MD) Len() int {
// Copy returns a copy of md.
func (md MD) Copy() MD {
+ return Join(md)
+}
+
+// Join joins any number of MDs into a single MD.
+// The order of values for each key is determined by the order in which
+// the MDs containing those values are presented to Join.
+func Join(mds ...MD) MD {
out := MD{}
- for k, v := range md {
- for _, i := range v {
- out[k] = append(out[k], i)
+ for _, md := range mds {
+ for k, v := range md {
+ out[k] = append(out[k], v...)
}
}
return out