From 607fdb6ee49525f1c3949228c5f9ff35c534db10 Mon Sep 17 00:00:00 2001 From: Alejandro Mery Date: Sat, 26 Jun 2021 18:59:50 +0100 Subject: [PATCH] envexp: add top-level Expand() using Getenv Signed-off-by: Alejandro Mery --- envexp/global.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 envexp/global.go diff --git a/envexp/global.go b/envexp/global.go new file mode 100644 index 0000000..f5ce294 --- /dev/null +++ b/envexp/global.go @@ -0,0 +1,14 @@ +package envexp + +import ( + "os" +) + +var envExpander = &expander{ + get: os.Getenv, +} + +// Expand uses os.GetEnv() to expand a given string +func Expand(s string) string { + return envExpander.Expand(s) +}