From 2472f437a6b3f1244508368410fdfca55e157e5d Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Thu, 10 Feb 2022 08:43:36 -0500 Subject: conv.URL - add example of how to redact the password Signed-off-by: Dave Henderson --- docs/content/functions/conv.md | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'docs') diff --git a/docs/content/functions/conv.md b/docs/content/functions/conv.md index 091e7191..32045e1d 100644 --- a/docs/content/functions/conv.md +++ b/docs/content/functions/conv.md @@ -228,6 +228,8 @@ $ gomplate -i '{{ $a := slice 1 2 3 }}{{ join $a "-" }}' Parses a string as a URL for later use. Equivalent to [url.Parse](https://golang.org/pkg/net/url/#Parse) +Any of `url.URL`'s methods can be called on the result. + ### Usage ```go @@ -256,6 +258,11 @@ The scheme is https The host is example.com:443 The path is /foo/bar ``` +_Call `Redacted` to hide the password in the output:_ +``` +$ gomplate -i '{{ (conv.URL "https://user:supersecret@example.com").Redacted }}' +https://user:xxxxx@example.com +``` ## `conv.ParseInt` -- cgit v1.2.3