From d5a8c1735b43793fae461e3f8d02ea09af040ad7 Mon Sep 17 00:00:00 2001 From: Marc Sauter Date: Wed, 11 Aug 2021 13:09:38 +0200 Subject: [PATCH] feat: add Config.Variables to be added to kong.Vars --- king.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/king.go b/king.go index d9f35b0..46885b0 100644 --- a/king.go +++ b/king.go @@ -20,6 +20,7 @@ type Config struct { Description string BuildInfo *BuildInfo ConfigPaths []string + Variables map[string]string FileResolver FileResolver } @@ -41,6 +42,10 @@ func DefaultOptions(c Config) []kong.Option { configPathsKey: c.pathString(), } + for k, v := range c.Variables { + vars[k] = v + } + if c.BuildInfo != nil { vars[versionKey] = c.BuildInfo.Version(c.Name).String()