diff options
Diffstat (limited to 'src/cmd/gofmt')
-rw-r--r-- | src/cmd/gofmt/gofmt_test.go | 4 | ||||
-rw-r--r-- | src/cmd/gofmt/rewrite.go | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/cmd/gofmt/gofmt_test.go b/src/cmd/gofmt/gofmt_test.go index a72530307..70700554b 100644 --- a/src/cmd/gofmt/gofmt_test.go +++ b/src/cmd/gofmt/gofmt_test.go @@ -20,8 +20,8 @@ func runTest(t *testing.T, dirname, in, out, flags string) { // process flags *simplifyAST = false *rewriteRule = "" - for _, flag := range strings.Split(flags, " ", -1) { - elts := strings.Split(flag, "=", 2) + for _, flag := range strings.Split(flags, " ") { + elts := strings.SplitN(flag, "=", 2) name := elts[0] value := "" if len(elts) == 2 { diff --git a/src/cmd/gofmt/rewrite.go b/src/cmd/gofmt/rewrite.go index 4c24282f3..f7f1fe824 100644 --- a/src/cmd/gofmt/rewrite.go +++ b/src/cmd/gofmt/rewrite.go @@ -22,7 +22,7 @@ func initRewrite() { rewrite = nil // disable any previous rewrite return } - f := strings.Split(*rewriteRule, "->", -1) + f := strings.Split(*rewriteRule, "->") if len(f) != 2 { fmt.Fprintf(os.Stderr, "rewrite rule must be of the form 'pattern -> replacement'\n") os.Exit(2) |