mirror of https://github.com/grpc/grpc-go.git
Documentation: fix metadata.FromContext example
metadata.FromContext returns additional boolean value. This fixes the example in metadata documentation.
This commit is contained in:
parent
54222d50cc
commit
c4adca718a
|
|
@ -70,7 +70,8 @@ Metadata can be retrieved from context using `FromContext`:
|
|||
|
||||
```go
|
||||
func (s *server) SomeRPC(ctx context.Context, in *pb.SomeRequest) (*pb.SomeResponse, err) {
|
||||
md := metadata.FromContext(ctx)
|
||||
md, ok := metadata.FromContext(ctx)
|
||||
// do something with metadata
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue