]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/godoc: use normal gofmt printer settings for playground fmt
authorAndrew Gerrand <adg@golang.org>
Mon, 5 Nov 2012 21:46:28 +0000 (22:46 +0100)
committerAndrew Gerrand <adg@golang.org>
Mon, 5 Nov 2012 21:46:28 +0000 (22:46 +0100)
R=gri
CC=golang-dev
https://golang.org/cl/6815081

src/cmd/godoc/play.go

index dc549c0ee554d01f8d2e00e1318578babca7f7a4..7033169c83fb4230c368e6fbe4ce8b866de74b01 100644 (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
        }