Skip to content

Commit

Permalink
jcall: Read JCALL_META for metadata if -meta is unset.
Browse files Browse the repository at this point in the history
  • Loading branch information
creachadair committed Jul 28, 2019
1 parent 1aac0c8 commit 3f71dc2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/jcall/jcall.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 3f71dc2

Please sign in to comment.