Format of debora output

This commit is contained in:
Jae Kwon
2015-04-19 16:20:00 -07:00
parent 8b36f308e2
commit a4c098ac0b
3 changed files with 109 additions and 3 deletions

View File

@@ -2,6 +2,23 @@ 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
}