| 1234567891011121314 |
- package context
- import (
- "context"
- "fmt"
- "google.golang.org/grpc/metadata"
- )
- func AppendToContext(ctx context.Context, key string, value interface{}) context.Context {
- ctx = context.WithValue(ctx, key, value)
- ctx = metadata.AppendToOutgoingContext(ctx, key, fmt.Sprint(value))
- return ctx
- }
|