1
0
mirror of https://github.com/golang/go synced 2024-11-25 23:58:02 -07:00

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

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
}