Skip to content

Commit 3da6ca0

Browse files
committed
Simplify and fix spelling errors in test files
Simplify using gofmt -s.
1 parent 71fa72d commit 3da6ca0

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

client_server_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ func TestProxyDial(t *testing.T) {
160160
}
161161

162162
if !connect {
163-
t.Log("connect not recieved")
164-
http.Error(w, "connect not recieved", 405)
163+
t.Log("connect not received")
164+
http.Error(w, "connect not received", 405)
165165
return
166166
}
167167
origHandler.ServeHTTP(w, r)
@@ -200,8 +200,8 @@ func TestProxyAuthorizationDial(t *testing.T) {
200200
}
201201

202202
if !connect {
203-
t.Log("connect with proxy authorization not recieved")
204-
http.Error(w, "connect with proxy authorization not recieved", 405)
203+
t.Log("connect with proxy authorization not received")
204+
http.Error(w, "connect with proxy authorization not received", 405)
205205
return
206206
}
207207
origHandler.ServeHTTP(w, r)
@@ -246,7 +246,7 @@ func TestDialCookieJar(t *testing.T) {
246246
u.Scheme = "https"
247247
}
248248

249-
cookies := []*http.Cookie{&http.Cookie{Name: "gorilla", Value: "ws", Path: "/"}}
249+
cookies := []*http.Cookie{{Name: "gorilla", Value: "ws", Path: "/"}}
250250
d.Jar.SetCookies(u, cookies)
251251

252252
ws, _, err := d.Dial(s.URL, nil)

conn_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ func TestBufioReadBytes(t *testing.T) {
366366
t.Fatalf("ReadBytes() returned %v", err)
367367
}
368368
if len(p) != len(m) {
369-
t.Fatalf("read returnd %d bytes, want %d bytes", len(p), len(m))
369+
t.Fatalf("read returned %d bytes, want %d bytes", len(p), len(m))
370370
}
371371
}
372372

util_test.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,29 +38,29 @@ var parseExtensionTests = []struct {
3838
value string
3939
extensions []map[string]string
4040
}{
41-
{`foo`, []map[string]string{map[string]string{"": "foo"}}},
41+
{`foo`, []map[string]string{{"": "foo"}}},
4242
{`foo, bar; baz=2`, []map[string]string{
43-
map[string]string{"": "foo"},
44-
map[string]string{"": "bar", "baz": "2"}}},
43+
{"": "foo"},
44+
{"": "bar", "baz": "2"}}},
4545
{`foo; bar="b,a;z"`, []map[string]string{
46-
map[string]string{"": "foo", "bar": "b,a;z"}}},
46+
{"": "foo", "bar": "b,a;z"}}},
4747
{`foo , bar; baz = 2`, []map[string]string{
48-
map[string]string{"": "foo"},
49-
map[string]string{"": "bar", "baz": "2"}}},
48+
{"": "foo"},
49+
{"": "bar", "baz": "2"}}},
5050
{`foo, bar; baz=2 junk`, []map[string]string{
51-
map[string]string{"": "foo"}}},
51+
{"": "foo"}}},
5252
{`foo junk, bar; baz=2 junk`, nil},
5353
{`mux; max-channels=4; flow-control, deflate-stream`, []map[string]string{
54-
map[string]string{"": "mux", "max-channels": "4", "flow-control": ""},
55-
map[string]string{"": "deflate-stream"}}},
54+
{"": "mux", "max-channels": "4", "flow-control": ""},
55+
{"": "deflate-stream"}}},
5656
{`permessage-foo; x="10"`, []map[string]string{
57-
map[string]string{"": "permessage-foo", "x": "10"}}},
57+
{"": "permessage-foo", "x": "10"}}},
5858
{`permessage-foo; use_y, permessage-foo`, []map[string]string{
59-
map[string]string{"": "permessage-foo", "use_y": ""},
60-
map[string]string{"": "permessage-foo"}}},
59+
{"": "permessage-foo", "use_y": ""},
60+
{"": "permessage-foo"}}},
6161
{`permessage-deflate; client_max_window_bits; server_max_window_bits=10 , permessage-deflate; client_max_window_bits`, []map[string]string{
62-
map[string]string{"": "permessage-deflate", "client_max_window_bits": "", "server_max_window_bits": "10"},
63-
map[string]string{"": "permessage-deflate", "client_max_window_bits": ""}}},
62+
{"": "permessage-deflate", "client_max_window_bits": "", "server_max_window_bits": "10"},
63+
{"": "permessage-deflate", "client_max_window_bits": ""}}},
6464
}
6565

6666
func TestParseExtensions(t *testing.T) {

0 commit comments

Comments
 (0)