Skip to content

Commit 9ff2aa4

Browse files
committed
[dev.go2go] cmd/gofmt, go/format: set []-mode for type parameters in a few more places
Now that we have mostly settled on the type parameter list syntax we should probably remove the various modes of parsing and printing. For now just set the UseBrackets flag explicitly when printing. Updates golang#41195. Change-Id: I56b06b4f930908579a38a140e8221618c8e2fa17 Reviewed-on: https://go-review.googlesource.com/c/go/+/252879 Run-TryBot: Robert Griesemer <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Robert Griesemer <[email protected]>
1 parent 8ea0120 commit 9ff2aa4

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/cmd/gofmt/gofmt.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ var (
4040
// Keep these in sync with go/format/format.go.
4141
const (
4242
tabWidth = 8
43-
printerMode = printer.UseSpaces | printer.TabIndent | printer.StdFormat
43+
printerMode = printer.UseSpaces | printer.TabIndent | printer.StdFormat | printer.UseBrackets
4444
)
4545

4646
var (

src/go/format/format.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
// Keep these in sync with cmd/gofmt/gofmt.go.
2828
const (
2929
tabWidth = 8
30-
printerMode = printer.UseSpaces | printer.TabIndent | printer.StdFormat
30+
printerMode = printer.UseSpaces | printer.TabIndent | printer.StdFormat | printer.UseBrackets
3131
)
3232

3333
var config = printer.Config{Mode: printerMode, Tabwidth: tabWidth}

0 commit comments

Comments
 (0)