diff --git a/transport/transport.go b/transport/transport.go index beb0a520a573..0fc4c146f90b 100644 --- a/transport/transport.go +++ b/transport/transport.go @@ -338,6 +338,12 @@ func (s *Stream) Read(p []byte) (n int, err error) { return } +// GoString is implemented by Stream so context.String() won't +// race when printing %#v. +func (s *Stream) GoString() string { + return fmt.Sprintf("", s, s.method) +} + // The key to save transport.Stream in the context. type streamKey struct{}