gofmt -s -w src misc
R=r, rsc
CC=golang-dev
https://golang.org/cl/2662041
diff --git a/src/pkg/path/path_test.go b/src/pkg/path/path_test.go
index 592e696..2bbb9244 100644
--- a/src/pkg/path/path_test.go
+++ b/src/pkg/path/path_test.go
@@ -15,52 +15,52 @@
var cleantests = []CleanTest{
// Already clean
- CleanTest{"", "."},
- CleanTest{"abc", "abc"},
- CleanTest{"abc/def", "abc/def"},
- CleanTest{"a/b/c", "a/b/c"},
- CleanTest{".", "."},
- CleanTest{"..", ".."},
- CleanTest{"../..", "../.."},
- CleanTest{"../../abc", "../../abc"},
- CleanTest{"/abc", "/abc"},
- CleanTest{"/", "/"},
+ {"", "."},
+ {"abc", "abc"},
+ {"abc/def", "abc/def"},
+ {"a/b/c", "a/b/c"},
+ {".", "."},
+ {"..", ".."},
+ {"../..", "../.."},
+ {"../../abc", "../../abc"},
+ {"/abc", "/abc"},
+ {"/", "/"},
// Remove trailing slash
- CleanTest{"abc/", "abc"},
- CleanTest{"abc/def/", "abc/def"},
- CleanTest{"a/b/c/", "a/b/c"},
- CleanTest{"./", "."},
- CleanTest{"../", ".."},
- CleanTest{"../../", "../.."},
- CleanTest{"/abc/", "/abc"},
+ {"abc/", "abc"},
+ {"abc/def/", "abc/def"},
+ {"a/b/c/", "a/b/c"},
+ {"./", "."},
+ {"../", ".."},
+ {"../../", "../.."},
+ {"/abc/", "/abc"},
// Remove doubled slash
- CleanTest{"abc//def//ghi", "abc/def/ghi"},
- CleanTest{"//abc", "/abc"},
- CleanTest{"///abc", "/abc"},
- CleanTest{"//abc//", "/abc"},
- CleanTest{"abc//", "abc"},
+ {"abc//def//ghi", "abc/def/ghi"},
+ {"//abc", "/abc"},
+ {"///abc", "/abc"},
+ {"//abc//", "/abc"},
+ {"abc//", "abc"},
// Remove . elements
- CleanTest{"abc/./def", "abc/def"},
- CleanTest{"/./abc/def", "/abc/def"},
- CleanTest{"abc/.", "abc"},
+ {"abc/./def", "abc/def"},
+ {"/./abc/def", "/abc/def"},
+ {"abc/.", "abc"},
// Remove .. elements
- CleanTest{"abc/def/ghi/../jkl", "abc/def/jkl"},
- CleanTest{"abc/def/../ghi/../jkl", "abc/jkl"},
- CleanTest{"abc/def/..", "abc"},
- CleanTest{"abc/def/../..", "."},
- CleanTest{"/abc/def/../..", "/"},
- CleanTest{"abc/def/../../..", ".."},
- CleanTest{"/abc/def/../../..", "/"},
- CleanTest{"abc/def/../../../ghi/jkl/../../../mno", "../../mno"},
+ {"abc/def/ghi/../jkl", "abc/def/jkl"},
+ {"abc/def/../ghi/../jkl", "abc/jkl"},
+ {"abc/def/..", "abc"},
+ {"abc/def/../..", "."},
+ {"/abc/def/../..", "/"},
+ {"abc/def/../../..", ".."},
+ {"/abc/def/../../..", "/"},
+ {"abc/def/../../../ghi/jkl/../../../mno", "../../mno"},
// Combinations
- CleanTest{"abc/./../def", "def"},
- CleanTest{"abc//./../def", "def"},
- CleanTest{"abc/../../././../def", "../../def"},
+ {"abc/./../def", "def"},
+ {"abc//./../def", "def"},
+ {"abc/../../././../def", "../../def"},
}
func TestClean(t *testing.T) {
@@ -76,11 +76,11 @@
}
var splittests = []SplitTest{
- SplitTest{"a/b", "a/", "b"},
- SplitTest{"a/b/", "a/b/", ""},
- SplitTest{"a/", "a/", ""},
- SplitTest{"a", "", "a"},
- SplitTest{"/", "/", ""},
+ {"a/b", "a/", "b"},
+ {"a/b/", "a/b/", ""},
+ {"a/", "a/", ""},
+ {"a", "", "a"},
+ {"/", "/", ""},
}
func TestSplit(t *testing.T) {
@@ -98,21 +98,21 @@
var jointests = []JoinTest{
// zero parameters
- JoinTest{[]string{}, ""},
+ {[]string{}, ""},
// one parameter
- JoinTest{[]string{""}, ""},
- JoinTest{[]string{"a"}, "a"},
+ {[]string{""}, ""},
+ {[]string{"a"}, "a"},
// two parameters
- JoinTest{[]string{"a", "b"}, "a/b"},
- JoinTest{[]string{"a", ""}, "a"},
- JoinTest{[]string{"", "b"}, "b"},
- JoinTest{[]string{"/", "a"}, "/a"},
- JoinTest{[]string{"/", ""}, "/"},
- JoinTest{[]string{"a/", "b"}, "a/b"},
- JoinTest{[]string{"a/", ""}, "a"},
- JoinTest{[]string{"", ""}, ""},
+ {[]string{"a", "b"}, "a/b"},
+ {[]string{"a", ""}, "a"},
+ {[]string{"", "b"}, "b"},
+ {[]string{"/", "a"}, "/a"},
+ {[]string{"/", ""}, "/"},
+ {[]string{"a/", "b"}, "a/b"},
+ {[]string{"a/", ""}, "a"},
+ {[]string{"", ""}, ""},
}
// join takes a []string and passes it to Join.
@@ -134,11 +134,11 @@
}
var exttests = []ExtTest{
- ExtTest{"path.go", ".go"},
- ExtTest{"path.pb.go", ".go"},
- ExtTest{"a.dir/b", ""},
- ExtTest{"a.dir/b.go", ".go"},
- ExtTest{"a.dir/", ""},
+ {"path.go", ".go"},
+ {"path.pb.go", ".go"},
+ {"a.dir/b", ""},
+ {"a.dir/b.go", ".go"},
+ {"a.dir/", ""},
}
func TestExt(t *testing.T) {
@@ -287,17 +287,17 @@
var basetests = []CleanTest{
// Already clean
- CleanTest{"", "."},
- CleanTest{".", "."},
- CleanTest{"/.", "."},
- CleanTest{"/", "/"},
- CleanTest{"////", "/"},
- CleanTest{"x/", "x"},
- CleanTest{"abc", "abc"},
- CleanTest{"abc/def", "def"},
- CleanTest{"a/b/.x", ".x"},
- CleanTest{"a/b/c.", "c."},
- CleanTest{"a/b/c.x", "c.x"},
+ {"", "."},
+ {".", "."},
+ {"/.", "."},
+ {"/", "/"},
+ {"////", "/"},
+ {"x/", "x"},
+ {"abc", "abc"},
+ {"abc/def", "def"},
+ {"a/b/.x", ".x"},
+ {"a/b/c.", "c."},
+ {"a/b/c.x", "c.x"},
}
func TestBase(t *testing.T) {
@@ -314,14 +314,14 @@
}
var isAbsTests = []IsAbsTest{
- IsAbsTest{"", false},
- IsAbsTest{"/", true},
- IsAbsTest{"/usr/bin/gcc", true},
- IsAbsTest{"..", false},
- IsAbsTest{"/a/../bb", true},
- IsAbsTest{".", false},
- IsAbsTest{"./", false},
- IsAbsTest{"lala", false},
+ {"", false},
+ {"/", true},
+ {"/usr/bin/gcc", true},
+ {"..", false},
+ {"/a/../bb", true},
+ {".", false},
+ {"./", false},
+ {"lala", false},
}
func TestIsAbs(t *testing.T) {