Add PrintfWithIndent function

This commit is contained in:
2021-02-16 20:20:18 -06:00
parent 01086e3c22
commit dd0bf763a3
2 changed files with 33 additions and 19 deletions

View File

@ -169,4 +169,9 @@ func YesNo(v bool) string {
func PrintWithIndent(indent int, s string) {
fmt.Printf("%*s%s", indent, "", s)
}
}
func PrintfWithIndent(indent int, format string, a ...interface{}) (n int, err error) {
format = fmt.Sprintf("%*s%s", indent, "", format)
return fmt.Printf(format, a...)
}