mirror of
https://github.com/tendermint/tendermint.git
synced 2026-02-11 06:11:07 +00:00
move all files to common/ to begin repo merge
This commit is contained in:
24
common/string.go
Normal file
24
common/string.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var Fmt = fmt.Sprintf
|
||||
|
||||
func RightPadString(s string, totalLength int) string {
|
||||
remaining := totalLength - len(s)
|
||||
if remaining > 0 {
|
||||
s = s + strings.Repeat(" ", remaining)
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
func LeftPadString(s string, totalLength int) string {
|
||||
remaining := totalLength - len(s)
|
||||
if remaining > 0 {
|
||||
s = strings.Repeat(" ", remaining) + s
|
||||
}
|
||||
return s
|
||||
}
|
||||
Reference in New Issue
Block a user