Fix nil input stream panic under Go jsonv2

This commit is contained in:
Scott Blum
2026-09-02 11:25:29 -04:00
parent cf21d4aca5
commit cfa6ff6886
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -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)
}