From 897d4d7aa61c32d45cf503114901ba072dc6de89 Mon Sep 17 00:00:00 2001 From: Luca Sepe Date: Fri, 21 May 2021 16:52:37 +0200 Subject: [PATCH] add example of http fetch to README --- README.md | 21 ++++++++++++++++++++- go.mod | 2 ++ go.sum | 4 ++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1c12af1..8876d97 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,26 @@ Example: $ tbd -vars testdata/sample1.vars testdata/sample1.yml.tbd ``` -> šŸ‘‰ you can also specify an HTTP url to fetch your template and/or placeholders values. +šŸ‘‰ you can also specify an HTTP url to fetch your template and/or placeholders values. + +Example: + +```sh +$ tbd -vars https://raw.githubusercontent.com/lucasepe/tbd/main/testdata/sample2.vars \ + https://raw.githubusercontent.com/lucasepe/tbd/main/testdata/sample2.txt.tbd +``` + +and the output is... + +```txt +Greetings + +I will be out of the office from August, 9 until August 23. +If you need immediate assistance while Iā€™m away, please email pinco.pallo@gmail.com. + +Best, +Pinco Pallo +``` ## How to list all template placeholders? diff --git a/go.mod b/go.mod index a142712..12286b9 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,5 @@ module github.com/lucasepe/tbd go 1.16 + +require github.com/google/go-cmp v0.5.5 diff --git a/go.sum b/go.sum index e69de29..0a5f3e0 100644 --- a/go.sum +++ b/go.sum @@ -0,0 +1,4 @@ +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=