diff --git a/cmd/grpcurl/grpcurl.go b/cmd/grpcurl/grpcurl.go index 7d83db4..66b2990 100644 --- a/cmd/grpcurl/grpcurl.go +++ b/cmd/grpcurl/grpcurl.go @@ -673,7 +673,6 @@ func main() { } h := &grpcurl.DefaultEventHandler{ Out: os.Stdout, - DescSource: descSource, Formatter: formatter, VerbosityLevel: verbosityLevel, } diff --git a/format.go b/format.go index dd1772a..98d6a24 100644 --- a/format.go +++ b/format.go @@ -409,9 +409,8 @@ func RequestParserAndFormatterFor(format Format, descSource DescriptorSource, em // safe for use with InvokeRPC as long as NumResponses and Status are not read // until the call to InvokeRPC completes. type DefaultEventHandler struct { - Out io.Writer - DescSource DescriptorSource - Formatter func(proto.Message) (string, error) + Out io.Writer + Formatter Formatter // 0 = default // 1 = verbose // 2 = very verbose @@ -439,7 +438,6 @@ func NewDefaultEventHandler(out io.Writer, descSource DescriptorSource, formatte } return &DefaultEventHandler{ Out: out, - DescSource: descSource, Formatter: formatter, VerbosityLevel: verbosityLevel, } @@ -449,7 +447,7 @@ var _ InvocationEventHandler = (*DefaultEventHandler)(nil) func (h *DefaultEventHandler) OnResolveMethod(md *desc.MethodDescriptor) { if h.VerbosityLevel > 0 { - txt, err := GetDescriptorText(md, h.DescSource) + txt, err := GetDescriptorText(md, nil) if err == nil { fmt.Fprintf(h.Out, "\nResolved method descriptor:\n%s\n", txt) } diff --git a/format_test.go b/format_test.go index b852f8a..1a36059 100644 --- a/format_test.go +++ b/format_test.go @@ -137,7 +137,6 @@ func TestHandler(t *testing.T) { var buf bytes.Buffer h := &DefaultEventHandler{ Out: &buf, - DescSource: source, Formatter: formatter, VerbosityLevel: verbosityLevel, }