From 7c34548921005ef9f965790b86fda8c9da04e9c5 Mon Sep 17 00:00:00 2001 From: Roy Olav Purser Date: Fri, 18 Jun 2021 15:17:55 +0200 Subject: [PATCH] quote values --- envconf.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/envconf.go b/envconf.go index 0dd7242..3f44bde 100644 --- a/envconf.go +++ b/envconf.go @@ -147,8 +147,8 @@ func (c *Config) help() { for k, v := range c.env { if v.dtype != TypeNone { if v.hasdef { - format := fmt.Sprintf("Variable %%-%ds| Type %%-%ds| Default %%s\n", max[0]+3, max[1]+3) - fmt.Printf(format, k, v.dtype, v.defval) + format := fmt.Sprintf("Variable %%-%ds| Type %%-%ds| Default %%s\n", max[0]+5, max[1]+3) + fmt.Printf(format, strings.Sprintf(`"%s"`, k), v.dtype, strings.Sprintf(`"%s"`, v.defval)) } } } @@ -158,8 +158,8 @@ func (c *Config) help() { for k, v := range c.env { if v.dtype != TypeNone { if !v.hasdef { - format := fmt.Sprintf("Variable %%-%ds| Type %%-%ds| Required\n", max[0]+3, max[1]+3) - fmt.Printf(format, k, v.dtype) + format := fmt.Sprintf("Variable %%-%ds| Type %%-%ds| Required\n", max[0]+5, max[1]+3) + fmt.Printf(format, strings.Sprintf(`"%s"`, k), v.dtype) } } }