diff --git a/api/cache.go b/api/cache.go index 620660c15..1f6d8896b 100644 --- a/api/cache.go +++ b/api/cache.go @@ -19,7 +19,7 @@ import ( func makeCachedClient(httpClient *http.Client, cacheTTL time.Duration) *http.Client { cacheDir := filepath.Join(os.TempDir(), "gh-cli-cache") return &http.Client{ - Transport: CacheReponse(cacheTTL, cacheDir)(httpClient.Transport), + Transport: CacheResponse(cacheTTL, cacheDir)(httpClient.Transport), } } @@ -39,8 +39,8 @@ func isCacheableResponse(res *http.Response) bool { return res.StatusCode < 500 && res.StatusCode != 403 } -// CacheReponse produces a RoundTripper that caches HTTP responses to disk for a specified amount of time -func CacheReponse(ttl time.Duration, dir string) ClientOption { +// CacheResponse produces a RoundTripper that caches HTTP responses to disk for a specified amount of time +func CacheResponse(ttl time.Duration, dir string) ClientOption { fs := fileStorage{ dir: dir, ttl: ttl, diff --git a/api/cache_test.go b/api/cache_test.go index d1039d71b..f4a6a756e 100644 --- a/api/cache_test.go +++ b/api/cache_test.go @@ -14,7 +14,7 @@ import ( "github.com/stretchr/testify/require" ) -func Test_CacheReponse(t *testing.T) { +func Test_CacheResponse(t *testing.T) { counter := 0 fakeHTTP := funcTripper{ roundTrip: func(req *http.Request) (*http.Response, error) { @@ -32,7 +32,7 @@ func Test_CacheReponse(t *testing.T) { } cacheDir := filepath.Join(t.TempDir(), "gh-cli-cache") - httpClient := NewHTTPClient(ReplaceTripper(fakeHTTP), CacheReponse(time.Minute, cacheDir)) + httpClient := NewHTTPClient(ReplaceTripper(fakeHTTP), CacheResponse(time.Minute, cacheDir)) do := func(method, url string, body io.Reader) (string, error) { req, err := http.NewRequest(method, url, body) diff --git a/context/remote_test.go b/context/remote_test.go index ab3f7e2e2..1d2140c90 100644 --- a/context/remote_test.go +++ b/context/remote_test.go @@ -28,11 +28,11 @@ func Test_Remotes_FindByName(t *testing.T) { eq(t, err, nil) eq(t, r.Name, "upstream") - r, err = list.FindByName("nonexist", "*") + r, err = list.FindByName("nonexistent", "*") eq(t, err, nil) eq(t, r.Name, "mona") - _, err = list.FindByName("nonexist") + _, err = list.FindByName("nonexistent") eq(t, err, errors.New(`no GitHub remotes found`)) } diff --git a/git/ssh_config_test.go b/git/ssh_config_test.go index 28f339aa6..7aafc5b21 100644 --- a/git/ssh_config_test.go +++ b/git/ssh_config_test.go @@ -25,7 +25,7 @@ func Test_sshParse(t *testing.T) { `)) eq(t, m["foo"], "example.com") eq(t, m["bar"], "%bar.net%") - eq(t, m["nonexist"], "") + eq(t, m["nonexistent"], "") } func Test_Translator(t *testing.T) { diff --git a/internal/config/config_file_test.go b/internal/config/config_file_test.go index f40cb9097..cc6ba287f 100644 --- a/internal/config/config_file_test.go +++ b/internal/config/config_file_test.go @@ -90,7 +90,7 @@ example.com: val, err = config.Get("github.com", "git_protocol") eq(t, err, nil) eq(t, val, "ssh") - val, err = config.Get("nonexist.io", "git_protocol") + val, err = config.Get("nonexistent.io", "git_protocol") eq(t, err, nil) eq(t, val, "ssh") } diff --git a/internal/docs/man_test.go b/internal/docs/man_test.go index 4e844ad61..58591e19e 100644 --- a/internal/docs/man_test.go +++ b/internal/docs/man_test.go @@ -106,7 +106,7 @@ func TestGenManSeeAlso(t *testing.T) { } } -func TestManPrintFlagsHidesShortDeperecated(t *testing.T) { +func TestManPrintFlagsHidesShortDeprecated(t *testing.T) { c := &cobra.Command{} c.Flags().StringP("foo", "f", "default", "Foo flag") _ = c.Flags().MarkShorthandDeprecated("foo", "don't use it no more") diff --git a/internal/run/stub.go b/internal/run/stub.go index 9bd6e279b..f11834c19 100644 --- a/internal/run/stub.go +++ b/internal/run/stub.go @@ -39,7 +39,7 @@ func Stub() (*CommandStubber, func(T)) { return } t.Helper() - t.Errorf("umatched stubs (%d): %s", len(unmatched), strings.Join(unmatched, ", ")) + t.Errorf("unmatched stubs (%d): %s", len(unmatched), strings.Join(unmatched, ", ")) } } diff --git a/pkg/cmd/issue/create/create_test.go b/pkg/cmd/issue/create/create_test.go index c89a349a0..0ced19b62 100644 --- a/pkg/cmd/issue/create/create_test.go +++ b/pkg/cmd/issue/create/create_test.go @@ -145,7 +145,7 @@ func TestIssueCreate_nonLegacyTemplate(t *testing.T) { as, teardown := prompt.InitAskStubber() defer teardown() - // tmeplate + // template as.Stub([]*prompt.QuestionStub{ { Name: "index", diff --git a/pkg/cmd/pr/create/regexp_writer_test.go b/pkg/cmd/pr/create/regexp_writer_test.go index fd772a760..f9ec0b863 100644 --- a/pkg/cmd/pr/create/regexp_writer_test.go +++ b/pkg/cmd/pr/create/regexp_writer_test.go @@ -93,14 +93,14 @@ func Test_Write(t *testing.T) { { name: "multiple lines removed", input: input{ - in: []string{"begining line\nremove this whole line\nremove this one also\nnot this one"}, + in: []string{"beginning line\nremove this whole line\nremove this one also\nnot this one"}, re: regexp.MustCompile("(?s)^remove.*$"), repl: "", }, output: output{ wantsErr: false, - out: "begining line\nnot this one", - length: 70, + out: "beginning line\nnot this one", + length: 71, }, }, { diff --git a/pkg/cmd/pr/review/review_test.go b/pkg/cmd/pr/review/review_test.go index b96ab8089..2184c264c 100644 --- a/pkg/cmd/pr/review/review_test.go +++ b/pkg/cmd/pr/review/review_test.go @@ -319,7 +319,7 @@ func TestPRReview(t *testing.T) { {`--request-changes -b"bad"`, "REQUEST_CHANGES", "bad"}, {`--approve`, "APPROVE", ""}, {`--approve -b"hot damn"`, "APPROVE", "hot damn"}, - {`--comment --body "i donno"`, "COMMENT", "i donno"}, + {`--comment --body "i dunno"`, "COMMENT", "i dunno"}, } for _, kase := range cases { diff --git a/pkg/cmd/pr/view/view.go b/pkg/cmd/pr/view/view.go index 1bb0eff1b..9dcdb8f8b 100644 --- a/pkg/cmd/pr/view/view.go +++ b/pkg/cmd/pr/view/view.go @@ -214,7 +214,7 @@ type reviewerState struct { func formattedReviewerState(cs *iostreams.ColorScheme, reviewer *reviewerState) string { state := reviewer.State if state == dismissedReviewState { - // Show "DISMISSED" review as "COMMENTED", since "dimissed" only makes + // Show "DISMISSED" review as "COMMENTED", since "dismissed" only makes // sense when displayed in an events timeline but not in the final tally. state = commentedReviewState } diff --git a/pkg/cmd/repo/create/http_test.go b/pkg/cmd/repo/create/http_test.go index c8e2e7a2a..360403538 100644 --- a/pkg/cmd/repo/create/http_test.go +++ b/pkg/cmd/repo/create/http_test.go @@ -17,7 +17,7 @@ func Test_RepoCreate(t *testing.T) { reg.StubResponse(200, bytes.NewBufferString(`{}`)) input := repoCreateInput{ - Description: "roasted chesnuts", + Description: "roasted chestnuts", HomepageURL: "http://example.com", } @@ -39,8 +39,8 @@ func Test_RepoCreate(t *testing.T) { bodyBytes, _ := ioutil.ReadAll(reg.Requests[0].Body) _ = json.Unmarshal(bodyBytes, &reqBody) - if description := reqBody.Variables.Input["description"].(string); description != "roasted chesnuts" { - t.Errorf("expected description to be %q, got %q", "roasted chesnuts", description) + if description := reqBody.Variables.Input["description"].(string); description != "roasted chestnuts" { + t.Errorf("expected description to be %q, got %q", "roasted chestnuts", description) } if homepage := reqBody.Variables.Input["homepageUrl"].(string); homepage != "http://example.com" { t.Errorf("expected homepageUrl to be %q, got %q", "http://example.com", homepage) diff --git a/pkg/cmd/repo/garden/garden.go b/pkg/cmd/repo/garden/garden.go index 359d8d898..c7ee048a7 100644 --- a/pkg/cmd/repo/garden/garden.go +++ b/pkg/cmd/repo/garden/garden.go @@ -190,7 +190,7 @@ func gardenRun(opts *GardenOptions) error { oldTTYCommand := exec.Command("stty", sttyFileArg, "/dev/tty", "-g") oldTTYSettings, err := oldTTYCommand.CombinedOutput() if err != nil { - fmt.Fprintln(out, "getting TTY setings failed:", string(oldTTYSettings)) + fmt.Fprintln(out, "getting TTY settings failed:", string(oldTTYSettings)) return err } diff --git a/pkg/cmd/root/help.go b/pkg/cmd/root/help.go index a3be5a27a..80b61341e 100644 --- a/pkg/cmd/root/help.go +++ b/pkg/cmd/root/help.go @@ -35,7 +35,7 @@ func rootUsageFunc(command *cobra.Command) error { return nil } -func rootFlagErrrorFunc(cmd *cobra.Command, err error) error { +func rootFlagErrorFunc(cmd *cobra.Command, err error) error { if err == pflag.ErrHelp { return err } diff --git a/pkg/cmd/root/root.go b/pkg/cmd/root/root.go index 93cb4431d..42c1b627f 100644 --- a/pkg/cmd/root/root.go +++ b/pkg/cmd/root/root.go @@ -59,7 +59,7 @@ func NewCmdRoot(f *cmdutil.Factory, version, buildDate string) *cobra.Command { cmd.PersistentFlags().Bool("help", false, "Show help for command") cmd.SetHelpFunc(helpHelper) cmd.SetUsageFunc(rootUsageFunc) - cmd.SetFlagErrorFunc(rootFlagErrrorFunc) + cmd.SetFlagErrorFunc(rootFlagErrorFunc) formattedVersion := versionCmd.Format(version, buildDate) cmd.SetVersionTemplate(formattedVersion)