From 4b0058dd6422eef7b8939fead2423aa692fecd2c Mon Sep 17 00:00:00 2001 From: Emmanuel T Odeke Date: Sun, 18 Mar 2018 04:19:23 -0700 Subject: [PATCH] common: remove {Left, Right}PadString (#168) Fixes #134 Those functions are unused in the whole Tendermint Github organization plus they were unnecessariy verbose and could have been concisely replaced with ```go func RightPadString(s string, totalLength uint) string { return fmt.Sprintf("% *s", totalLength, s) } func LeftPadString(s string, totalLength uint) string { return fmt.Sprintf("% -*s", totalLength, s) } ``` delete them anyways --- common/string.go | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/common/string.go b/common/string.go index 64484921f..ae140c9f4 100644 --- a/common/string.go +++ b/common/string.go @@ -15,24 +15,6 @@ var Fmt = func(format string, a ...interface{}) string { } } -// RightPadString adds spaces to the right of a string to make it length totalLength -func RightPadString(s string, totalLength int) string { - remaining := totalLength - len(s) - if remaining > 0 { - s = s + strings.Repeat(" ", remaining) - } - return s -} - -// LeftPadString adds spaces to the left of a string to make it length totalLength -func LeftPadString(s string, totalLength int) string { - remaining := totalLength - len(s) - if remaining > 0 { - s = strings.Repeat(" ", remaining) + s - } - return s -} - // IsHex returns true for non-empty hex-string prefixed with "0x" func IsHex(s string) bool { if len(s) > 2 && strings.EqualFold(s[:2], "0x") {