cmd/godoc: use normal gofmt printer settings for playground fmt

R=gri
CC=golang-dev
https://golang.org/cl/6815081
This commit is contained in:
Andrew Gerrand 2012-11-05 22:46:28 +01:00
parent 834028d527
commit c1c136d0c4
1 changed files with 5 additions and 1 deletions

View File

@ -59,7 +59,11 @@ func gofmt(body string) (string, error) {
}
ast.SortImports(fset, f)
var buf bytes.Buffer
err = printer.Fprint(&buf, fset, f)
config := printer.Config{
Mode: printer.UseSpaces | printer.TabIndent,
Tabwidth: 8,
}
err = config.Fprint(&buf, fset, f)
if err != nil {
return "", err
}