9 // Fmt shorthand, XXX DEPRECATED
12 // RightPadString adds spaces to the right of a string to make it length totalLength
13 func RightPadString(s string, totalLength int) string {
14 remaining := totalLength - len(s)
16 s = s + strings.Repeat(" ", remaining)
21 // LeftPadString adds spaces to the left of a string to make it length totalLength
22 func LeftPadString(s string, totalLength int) string {
23 remaining := totalLength - len(s)
25 s = strings.Repeat(" ", remaining) + s
30 // IsHex returns true for non-empty hex-string prefixed with "0x"
31 func IsHex(s string) bool {
32 if len(s) > 2 && s[:2] == "0x" {
33 _, err := hex.DecodeString(s[2:])
39 // StripHex returns hex string without leading "0x"
40 func StripHex(s string) string {