mirror of
https://github.com/fullstorydev/grpcurl.git
synced 2026-11-06 07:41:52 +03:00
Fix nil input stream panic under Go jsonv2
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"flag"
|
||||
"fmt"
|
||||
@@ -764,7 +765,7 @@ func main() {
|
||||
// create a request to invoke an RPC
|
||||
tmpl := grpcurl.MakeTemplate(dsc)
|
||||
options := grpcurl.FormatOptions{EmitJSONDefaultFields: true}
|
||||
_, formatter, err := grpcurl.RequestParserAndFormatter(grpcurl.Format(*format), descSource, nil, options)
|
||||
_, formatter, err := grpcurl.RequestParserAndFormatter(grpcurl.Format(*format), descSource, bytes.NewReader(nil), options)
|
||||
if err != nil {
|
||||
fail(err, "Failed to construct formatter for %q", *format)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user