Use printf field widths instead of strings.Repeat. (#9681)

This commit is contained in:
ncabatoff 2020-08-07 08:54:23 -04:00 committed by GitHub
parent 4ca978598f
commit b0a3972892
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 5 deletions

View File

@ -1513,16 +1513,12 @@ CLUSTER_SYNTHESIS_COMPLETE:
infoKeys = append(infoKeys, "go version")
info["go version"] = runtime.Version()
// Server configuration output
padding := 24
sort.Strings(infoKeys)
c.UI.Output("==> Vault server configuration:\n")
for _, k := range infoKeys {
c.UI.Output(fmt.Sprintf(
"%s%s: %s",
strings.Repeat(" ", padding-len(k)),
"%24s: %s",
strings.Title(k),
info[k]))
}