From 45a3d0b526ad9a095339f157edb5470d380f3a5e Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Mon, 5 Sep 2016 10:20:34 -0600 Subject: [PATCH] Fix misspellings --- caddyhttp/basicauth/basicauth.go | 2 +- caddyhttp/browse/browse_test.go | 4 ++-- caddyhttp/browse/setup_test.go | 6 +++--- caddyhttp/extensions/ext.go | 2 +- caddyhttp/httpserver/condition_test.go | 2 +- caddyhttp/pprof/pprof_test.go | 2 +- caddyhttp/redirect/setup_test.go | 22 +++++++++++----------- caddyhttp/websocket/websocket.go | 2 +- caddytls/maintain.go | 2 +- commands_test.go | 4 ++-- startupshutdown/startupshutdown_test.go | 4 ++-- 11 files changed, 26 insertions(+), 26 deletions(-) diff --git a/caddyhttp/basicauth/basicauth.go b/caddyhttp/basicauth/basicauth.go index c8b6075f5..db12332aa 100644 --- a/caddyhttp/basicauth/basicauth.go +++ b/caddyhttp/basicauth/basicauth.go @@ -68,7 +68,7 @@ func (a BasicAuth) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error return a.Next.ServeHTTP(w, r) } - // Pass-thru when no paths match + // Pass-through when no paths match return a.Next.ServeHTTP(w, r) } diff --git a/caddyhttp/browse/browse_test.go b/caddyhttp/browse/browse_test.go index eb200d3f6..2c494538f 100644 --- a/caddyhttp/browse/browse_test.go +++ b/caddyhttp/browse/browse_test.go @@ -96,7 +96,7 @@ func TestSort(t *testing.T) { func TestBrowseHTTPMethods(t *testing.T) { tmpl, err := template.ParseFiles("testdata/photos.tpl") if err != nil { - t.Fatalf("An error occured while parsing the template: %v", err) + t.Fatalf("An error occurred while parsing the template: %v", err) } b := Browse{ @@ -134,7 +134,7 @@ func TestBrowseHTTPMethods(t *testing.T) { func TestBrowseTemplate(t *testing.T) { tmpl, err := template.ParseFiles("testdata/photos.tpl") if err != nil { - t.Fatalf("An error occured while parsing the template: %v", err) + t.Fatalf("An error occurred while parsing the template: %v", err) } b := Browse{ diff --git a/caddyhttp/browse/setup_test.go b/caddyhttp/browse/setup_test.go index e6cb16515..0531cc224 100644 --- a/caddyhttp/browse/setup_test.go +++ b/caddyhttp/browse/setup_test.go @@ -52,15 +52,15 @@ func TestSetup(t *testing.T) { c := caddy.NewTestController("http", test.input) err := setup(c) if err != nil && !test.shouldErr { - t.Errorf("Test case #%d recieved an error of %v", i, err) + t.Errorf("Test case #%d received an error of %v", i, err) } if test.expectedPathScope == nil { continue } mids := httpserver.GetConfig(c).Middleware() mid := mids[len(mids)-1] - recievedConfigs := mid(nil).(Browse).Configs - for j, config := range recievedConfigs { + receivedConfigs := mid(nil).(Browse).Configs + for j, config := range receivedConfigs { if config.PathScope != test.expectedPathScope[j] { t.Errorf("Test case #%d expected a pathscope of %v, but got %v", i, test.expectedPathScope, config.PathScope) } diff --git a/caddyhttp/extensions/ext.go b/caddyhttp/extensions/ext.go index 46013b406..6a3c77120 100644 --- a/caddyhttp/extensions/ext.go +++ b/caddyhttp/extensions/ext.go @@ -21,7 +21,7 @@ type Ext struct { // Next handler in the chain Next httpserver.Handler - // Path to ther root of the site + // Path to site root Root string // List of extensions to try diff --git a/caddyhttp/httpserver/condition_test.go b/caddyhttp/httpserver/condition_test.go index e11cc11ad..8f2afdca7 100644 --- a/caddyhttp/httpserver/condition_test.go +++ b/caddyhttp/httpserver/condition_test.go @@ -206,7 +206,7 @@ func TestSetupIfMatcher(t *testing.T) { }`, true, IfMatcher{}, }, {`test { - if a isnt b + if a isn't b }`, true, IfMatcher{}, }, {`test { diff --git a/caddyhttp/pprof/pprof_test.go b/caddyhttp/pprof/pprof_test.go index 816658694..2b870eb82 100644 --- a/caddyhttp/pprof/pprof_test.go +++ b/caddyhttp/pprof/pprof_test.go @@ -45,7 +45,7 @@ func TestServeHTTP(t *testing.T) { t.Errorf("Test two: Expected nil error, but got: %v", err) } if w.Body.String() != "content" { - t.Errorf("Expected pprof to pass the request thru, but it didn't; got: %s", w.Body.String()) + t.Errorf("Expected pprof to pass the request through, but it didn't; got: %s", w.Body.String()) } } diff --git a/caddyhttp/redirect/setup_test.go b/caddyhttp/redirect/setup_test.go index 5eb04eb8e..bb082fd84 100644 --- a/caddyhttp/redirect/setup_test.go +++ b/caddyhttp/redirect/setup_test.go @@ -69,25 +69,25 @@ func TestSetup(t *testing.T) { c := caddy.NewTestController("http", test.input) err := setup(c) if err != nil && !test.shouldErr { - t.Errorf("Test case #%d recieved an error of %v", j, err) + t.Errorf("Test case #%d received an error of %v", j, err) } else if test.shouldErr { continue } mids := httpserver.GetConfig(c).Middleware() - recievedRules := mids[len(mids)-1](nil).(Redirect).Rules + receivedRules := mids[len(mids)-1](nil).(Redirect).Rules - for i, recievedRule := range recievedRules { - if recievedRule.FromPath != test.expectedRules[i].FromPath { - t.Errorf("Test case #%d.%d expected a from path of %s, but recieved a from path of %s", j, i, test.expectedRules[i].FromPath, recievedRule.FromPath) + for i, receivedRule := range receivedRules { + if receivedRule.FromPath != test.expectedRules[i].FromPath { + t.Errorf("Test case #%d.%d expected a from path of %s, but received a from path of %s", j, i, test.expectedRules[i].FromPath, receivedRule.FromPath) } - if recievedRule.To != test.expectedRules[i].To { - t.Errorf("Test case #%d.%d expected a TO path of %s, but recieved a TO path of %s", j, i, test.expectedRules[i].To, recievedRule.To) + if receivedRule.To != test.expectedRules[i].To { + t.Errorf("Test case #%d.%d expected a TO path of %s, but received a TO path of %s", j, i, test.expectedRules[i].To, receivedRule.To) } - if recievedRule.Code != test.expectedRules[i].Code { - t.Errorf("Test case #%d.%d expected a HTTP status code of %d, but recieved a code of %d", j, i, test.expectedRules[i].Code, recievedRule.Code) + if receivedRule.Code != test.expectedRules[i].Code { + t.Errorf("Test case #%d.%d expected a HTTP status code of %d, but received a code of %d", j, i, test.expectedRules[i].Code, receivedRule.Code) } - if gotMatcher, expectMatcher := fmt.Sprint(recievedRule.RequestMatcher), fmt.Sprint(test.expectedRules[i].RequestMatcher); gotMatcher != expectMatcher { - t.Errorf("Test case #%d.%d expected a Matcher %s, but recieved a Matcher %s", j, i, expectMatcher, gotMatcher) + if gotMatcher, expectMatcher := fmt.Sprint(receivedRule.RequestMatcher), fmt.Sprint(test.expectedRules[i].RequestMatcher); gotMatcher != expectMatcher { + t.Errorf("Test case #%d.%d expected a Matcher %s, but received a Matcher %s", j, i, expectMatcher, gotMatcher) } } } diff --git a/caddyhttp/websocket/websocket.go b/caddyhttp/websocket/websocket.go index ca135f33f..3bead97b0 100644 --- a/caddyhttp/websocket/websocket.go +++ b/caddyhttp/websocket/websocket.go @@ -72,7 +72,7 @@ func (ws WebSocket) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, erro } } - // Didn't match a websocket path, so pass-thru + // Didn't match a websocket path, so pass-through return ws.Next.ServeHTTP(w, r) } diff --git a/caddytls/maintain.go b/caddytls/maintain.go index aad41d5e4..9ed47ccd0 100644 --- a/caddytls/maintain.go +++ b/caddytls/maintain.go @@ -248,7 +248,7 @@ func DeleteOldStapleFiles() { } for _, file := range files { if file.IsDir() { - // wierd, what's a folder doing inside the OCSP cache? + // weird, what's a folder doing inside the OCSP cache? continue } stapleFile := filepath.Join(ocspFolder, file.Name()) diff --git a/commands_test.go b/commands_test.go index 5de37c761..cafc1dcc7 100644 --- a/commands_test.go +++ b/commands_test.go @@ -12,7 +12,7 @@ func TestParseUnixCommand(t *testing.T) { input string expected []string }{ - // 0 - emtpy command + // 0 - empty command { input: ``, expected: []string{}, @@ -181,7 +181,7 @@ func TestSplitCommandAndArgs(t *testing.T) { expectedArgs []string expectedErrContent string }{ - // 0 - emtpy command + // 0 - empty command { input: ``, expectedCommand: ``, diff --git a/startupshutdown/startupshutdown_test.go b/startupshutdown/startupshutdown_test.go index 9cc28437e..01af82db7 100644 --- a/startupshutdown/startupshutdown_test.go +++ b/startupshutdown/startupshutdown_test.go @@ -56,11 +56,11 @@ func TestStartup(t *testing.T) { } err = registeredFunction() if err != nil && !test.shouldExecutionErr { - t.Errorf("Test %d recieved an error of:\n%v", i, err) + t.Errorf("Test %d received an error of:\n%v", i, err) } err = os.Remove(osSenitiveTestDir) if err != nil && !test.shouldRemoveErr { - t.Errorf("Test %d recieved an error of:\n%v", i, err) + t.Errorf("Test %d received an error of:\n%v", i, err) } } }