Skip to content

Commit

Permalink
Add new PaddedKey function used in CLI and Frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
vkuznet committed Apr 26, 2024
1 parent 4608e3a commit 976a550
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,3 +226,14 @@ func Domain() string {
log.Println("Domain", domain)
return domain
}

// PaddedKey returns padded key up to maxLen
func PaddedKey(key string, maxLen int) string {
if len(key) < maxLen {
pad := maxLen - len(key)
for i := 0; i < pad; i++ {
key += " "
}
}
return key
}

0 comments on commit 976a550

Please sign in to comment.