use fmt for format

This commit is contained in:
Roy Olav Purser 2021-06-18 15:20:38 +02:00
parent 7c34548921
commit a436aff825
Signed by: roypur
GPG Key ID: E14D26A036F21656

View File

@ -148,7 +148,7 @@ func (c *Config) help() {
if v.dtype != TypeNone { if v.dtype != TypeNone {
if v.hasdef { if v.hasdef {
format := fmt.Sprintf("Variable %%-%ds| Type %%-%ds| Default %%s\n", max[0]+5, max[1]+3) 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)) fmt.Printf(format, fmt.Sprintf(`"%s"`, k), v.dtype, fmt.Sprintf(`"%s"`, v.defval))
} }
} }
} }
@ -159,7 +159,7 @@ func (c *Config) help() {
if v.dtype != TypeNone { if v.dtype != TypeNone {
if !v.hasdef { if !v.hasdef {
format := fmt.Sprintf("Variable %%-%ds| Type %%-%ds| Required\n", max[0]+5, max[1]+3) format := fmt.Sprintf("Variable %%-%ds| Type %%-%ds| Required\n", max[0]+5, max[1]+3)
fmt.Printf(format, strings.Sprintf(`"%s"`, k), v.dtype) fmt.Printf(format, fmt.Sprintf(`"%s"`, k), v.dtype)
} }
} }
} }