dcsunny 4 years ago
parent
commit
8240ad74d6
1 changed files with 1 additions and 6 deletions
  1. 1 6
      http/context/context.go

+ 1 - 6
http/context/context.go

@@ -21,11 +21,6 @@ func AppendToContext(ctx context.Context, key string, value interface{}) context
 		_value = fmt.Sprint(value)
 		break
 	}
-	md, _, ex := metadata.FromOutgoingContextRaw(ctx)
-	if !ex {
-		md = metadata.New(map[string]string{})
-	}
-	md.Set(key, _value)
-	ctx = metadata.NewOutgoingContext(ctx, md)
+	ctx = metadata.AppendToOutgoingContext(ctx, key, _value)
 	return ctx
 }