Source File
metadata.go
Belonging Package
google.golang.org/grpc/metadata
package metadata // import "google.golang.org/grpc/metadata"
import (
)
func ( ...MD) MD {
:= MD{}
for , := range {
for , := range {
[] = append([], ...)
}
}
return
}
type mdIncomingKey struct{}
type mdOutgoingKey struct{}
func ( context.Context, ...string) context.Context {
if len()%2 == 1 {
panic(fmt.Sprintf("metadata: AppendToOutgoingContext got an odd number of input pairs for metadata: %d", len()))
}
, := .Value(mdOutgoingKey{}).(rawMD)
:= make([][]string, len(.added)+1)
copy(, .added)
[len()-1] = make([]string, len())
copy([len()-1], )
return context.WithValue(, mdOutgoingKey{}, rawMD{md: .md, added: })
}
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |