Skip to content

Commit

Permalink
Merge pull request #45 from knz/20190411-align
Browse files Browse the repository at this point in the history
Preserve full alignment in data responses
  • Loading branch information
maddyblue authored Apr 11, 2019
2 parents 1ef4b4b + 703f5a7 commit c900015
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func fmtsql(cfg tree.PrettyCfg, stmts []string) (string, error) {
break
}
// Remove trailing whitespace but keep up to 2 newlines.
prettied.WriteString(strings.TrimSpace(found))
prettied.WriteString(strings.TrimRightFunc(found, unicode.IsSpace))
newlines := strings.Count(found, "\n")
if newlines > 2 {
newlines = 2
Expand Down Expand Up @@ -177,7 +177,7 @@ func fmtsql(cfg tree.PrettyCfg, stmts []string) (string, error) {
}
}

return strings.TrimSpace(prettied.String()), nil
return strings.TrimRightFunc(prettied.String(), unicode.IsSpace), nil
}

func serveHTTP(spec Specification) {
Expand Down

0 comments on commit c900015

Please sign in to comment.