diff --git a/cmd/getignore.go b/cmd/getignore.go index b4bd5df..6514c17 100644 --- a/cmd/getignore.go +++ b/cmd/getignore.go @@ -122,7 +122,7 @@ func getPaths(baseurl string) (paths []string, err error) { baseurl = "https://api.github.com" } - url := fmt.Sprintf("%s/repos/github/gitignore/git/trees/master?recursive=1", baseurl) + url := fmt.Sprintf("%s/repos/github/gitignore/git/trees/main?recursive=1", baseurl) resp, err := http.Get(url) if err != nil { @@ -216,7 +216,7 @@ func (rc *RestClient) Run(args []string) (output string, err error) { } for _, lang := range langs { - url := fmt.Sprintf("%s/github/gitignore/master/%s.gitignore", baseurl, lang) + url := fmt.Sprintf("%s/github/gitignore/main/%s.gitignore", baseurl, lang) resp, err := http.Get(url) if err != nil { diff --git a/cmd/getignore_test.go b/cmd/getignore_test.go index b3afc02..cdfc1c5 100644 --- a/cmd/getignore_test.go +++ b/cmd/getignore_test.go @@ -117,10 +117,10 @@ dist/ func TestRun(t *testing.T) { server := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) { - if req.URL.String() == "/repos/github/gitignore/git/trees/master?recursive=1" { + if req.URL.String() == "/repos/github/gitignore/git/trees/main?recursive=1" { rw.Write([]byte(cannedTreeResponse)) } - if req.URL.String() == "/github/gitignore/master/Go.gitignore" { + if req.URL.String() == "/github/gitignore/main/Go.gitignore" { rw.Write([]byte(cannedGitignore)) } }))