1) Change default gofmt default settings for
parsing and printing to new syntax.
Use -oldparser to parse the old syntax,
use -oldprinter to print the old syntax.
2) Change default gofmt formatting settings
to use tabs for indentation only and to use
spaces for alignment. This will make the code
alignment insensitive to an editor's tabwidth.
Use -spaces=false to use tabs for alignment.
3) Manually changed src/exp/parser/parser_test.go
so that it doesn't try to parse the parser's
source files using the old syntax (they have
new syntax now).
4) gofmt -w src misc test/bench
4th set of files.
R=rsc
CC=golang-dev
https://golang.org/cl/180049
diff --git a/src/pkg/strconv/quote_test.go b/src/pkg/strconv/quote_test.go
index 3c42d39..3178487 100644
--- a/src/pkg/strconv/quote_test.go
+++ b/src/pkg/strconv/quote_test.go
@@ -5,14 +5,14 @@
package strconv_test
import (
- "os";
- . "strconv";
- "testing";
+ "os"
+ . "strconv"
+ "testing"
)
type quoteTest struct {
- in string;
- out string;
+ in string
+ out string
}
var quotetests = []quoteTest{
@@ -26,7 +26,7 @@
func TestQuote(t *testing.T) {
for i := 0; i < len(quotetests); i++ {
- tt := quotetests[i];
+ tt := quotetests[i]
if out := Quote(tt.in); out != tt.out {
t.Errorf("Quote(%s) = %s, want %s", tt.in, out, tt.out)
}
@@ -34,8 +34,8 @@
}
type canBackquoteTest struct {
- in string;
- out bool;
+ in string
+ out bool
}
var canbackquotetests = []canBackquoteTest{
@@ -49,7 +49,7 @@
canBackquoteTest{string(6), false},
canBackquoteTest{string(7), false},
canBackquoteTest{string(8), false},
- canBackquoteTest{string(9), true}, // \t
+ canBackquoteTest{string(9), true}, // \t
canBackquoteTest{string(10), false},
canBackquoteTest{string(11), false},
canBackquoteTest{string(12), false},
@@ -81,7 +81,7 @@
func TestCanBackquote(t *testing.T) {
for i := 0; i < len(canbackquotetests); i++ {
- tt := canbackquotetests[i];
+ tt := canbackquotetests[i]
if out := CanBackquote(tt.in); out != tt.out {
t.Errorf("CanBackquote(%q) = %v, want %v", tt.in, out, tt.out)
}
@@ -147,7 +147,7 @@
func TestUnquote(t *testing.T) {
for i := 0; i < len(unquotetests); i++ {
- tt := unquotetests[i];
+ tt := unquotetests[i]
if out, err := Unquote(tt.in); err != nil && out != tt.out {
t.Errorf("Unquote(%#q) = %q, %v want %q, nil", tt.in, out, err, tt.out)
}
@@ -155,14 +155,14 @@
// run the quote tests too, backward
for i := 0; i < len(quotetests); i++ {
- tt := quotetests[i];
+ tt := quotetests[i]
if in, err := Unquote(tt.out); in != tt.in {
t.Errorf("Unquote(%#q) = %q, %v, want %q, nil", tt.out, in, err, tt.in)
}
}
for i := 0; i < len(misquoted); i++ {
- s := misquoted[i];
+ s := misquoted[i]
if out, err := Unquote(s); out != "" || err != os.EINVAL {
t.Errorf("Unquote(%#q) = %q, %v want %q, %v", s, out, err, "", os.EINVAL)
}