diff --git a/transport/transport.go b/transport/transport.go index df67d57e8d79..b62f70290feb 100644 --- a/transport/transport.go +++ b/transport/transport.go @@ -341,6 +341,12 @@ func (s *Stream) finish(st *status.Status) { close(s.done) } +// 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{}