summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorDave Henderson <dhenderson@gmail.com>2022-02-10 08:43:36 -0500
committerDave Henderson <dhenderson@gmail.com>2022-02-10 10:18:13 -0500
commit2472f437a6b3f1244508368410fdfca55e157e5d (patch)
tree14be003603663f0247ac87dd36fcc8d217cf34f5 /docs
parent9e1116b00e5657a032c491dce123d54dabbadfb4 (diff)
conv.URL - add example of how to redact the password
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/content/functions/conv.md7
1 files changed, 7 insertions, 0 deletions
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`