From 3f71dc2abcb06cda1926f6bcf96c0cff7c3b0f35 Mon Sep 17 00:00:00 2001 From: "M. J. Fromberger" Date: Sun, 28 Jul 2019 09:06:36 -0700 Subject: [PATCH] jcall: Read JCALL_META for metadata if -meta is unset. --- cmd/jcall/jcall.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/jcall/jcall.go b/cmd/jcall/jcall.go index a550a9f..3a4621d 100644 --- a/cmd/jcall/jcall.go +++ b/cmd/jcall/jcall.go @@ -84,6 +84,9 @@ func main() { // Set up the context for the call, including timeouts and any metadata that // are specified on the command line. Setting -meta also implicitly sets -c. ctx := context.Background() + if *withMeta == "" { + *withMeta = os.Getenv("JCALL_META") + } if *withMeta != "" { mc, err := jctx.WithMetadata(ctx, json.RawMessage(*withMeta)) if err != nil {