Tweaks to output.

This commit is contained in:
Daniel Jones 2013-03-18 20:35:56 -07:00
parent 1ab6af4d3c
commit 82ec5bfab4
2 changed files with 3 additions and 7 deletions

View file

@ -46,19 +46,15 @@ func stripIndentation(s string, mincol int) string {
func printIndented(out io.Writer, s string, ind int) {
indentation := strings.Repeat(" ", ind)
reader := bufio.NewReader(strings.NewReader(s))
firstline := true
for {
line, err := reader.ReadString('\n')
if len(line) > 0 {
if !firstline {
io.WriteString(out, indentation)
}
io.WriteString(out, indentation)
io.WriteString(out, line)
}
if err != nil {
break
}
firstline = false
}
}