diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index 9d03a7c..8e48a5c 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -57,7 +57,7 @@ jobs: uses: asdf-vm/actions/install@v4 # uses: asdf-vm/actions/install@9cd779f40fe38688dd19505ccbc4eaaf018b44e7 with: - asdf_version: 0.18.0 + asdf_version: 0.19.0 - name: Check out full code history run: | diff --git a/.tool-versions b/.tool-versions index 74bf691..2f048aa 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,11 +1,11 @@ # UPDATE_HERE # https://golang.org/dl/ -golang 1.25.5 +golang 1.26.4 # https://github.com/goreleaser/goreleaser/releases -goreleaser 2.13.2 +goreleaser 2.16.0 # https://github.com/vektra/mockery/releases -mockery 3.6.1 +mockery 3.7.0 # https://github.com/caarlos0/svu/releases -svu 3.3.0 +svu 3.4.1 # https://github.com/golangci/golangci-lint/releases -golangci-lint 2.8.0 +golangci-lint 2.12.2 diff --git a/Makefile b/Makefile index 739f779..e2c4034 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,7 @@ test: ## Placeholder to run unit tests .PHONY: check check: ## Runs linting @echo "Linting" - @for d in $$(go list ./... | egrep -v 'vendor|asdf'); do staticcheck $${d}; done + golangci-lint run ./... @echo .PHONY: fmt diff --git a/bitbucket/bitbucket_test.go b/bitbucket/bitbucket_test.go index ca34b96..3f74b3e 100644 --- a/bitbucket/bitbucket_test.go +++ b/bitbucket/bitbucket_test.go @@ -10,6 +10,8 @@ import ( "github.com/stretchr/testify/assert" ) +const expectedProjectName = "MYPROJECTNAME" + func TestGitGetBitbucket_Init_Success(t *testing.T) { // Set up environment variables originalUsername := os.Getenv("BITBUCKET_USERNAME") @@ -67,12 +69,12 @@ func TestGenerateProjectKey(t *testing.T) { { name: "name with hyphens", input: "my-project-name", - expected: "MYPROJECTNAME", + expected: expectedProjectName, }, { name: "name with special chars", input: "my@project#name!", - expected: "MYPROJECTNAME", + expected: expectedProjectName, }, { name: "name with underscores", @@ -87,7 +89,7 @@ func TestGenerateProjectKey(t *testing.T) { { name: "name with dots", input: "my.project.name", - expected: "MYPROJECTNAME", + expected: expectedProjectName, }, { name: "complex name", diff --git a/gitget/get.go b/gitget/get.go index a8b3296..e6a7c6e 100644 --- a/gitget/get.go +++ b/gitget/get.go @@ -50,6 +50,18 @@ import ( const ( HTTPS = "https" SSH = "ssh" + + gitCmdClone = "clone" + gitCmdDiff = "diff" + gitCmdRevParse = "rev-parse" + gitCmdShowRef = "show-ref" + gitCmdStash = "stash" + gitFlagMirror = "--mirror" + gitFlagBranch = "--branch" + gitFlagQuiet = "--quiet" + gitFlagAbbrevRef = "--abbrev-ref" + gitFlagVerify = "--verify" + gitRefHEAD = "HEAD" ) var ( @@ -274,7 +286,7 @@ func (repo *Repo) SetRepoFullPath() { } // PathExists returns `true` if given `path` passed as sting exists, otherwise returns false. -func PathExists(pathToCheck string) (bool, os.FileInfo) { +func PathExists(pathToCheck string) (exists bool, info os.FileInfo) { finfo, err := os.Stat(pathToCheck) if os.IsNotExist(err) { @@ -293,7 +305,7 @@ func (repo *Repo) CloneMirror() bool { log.Infof("%s: Clone repository '%s' for mirror", repo.sha, repo.URL) var serr bytes.Buffer _, err := (*repo.executor).ExecGitCommand( - []string{"clone", "--mirror", repo.URL, repo.fullPath}, + []string{gitCmdClone, gitFlagMirror, repo.URL, repo.fullPath}, nil, &serr, "", @@ -310,7 +322,7 @@ func (repo *Repo) PushMirror() bool { log.Infof("%s: Push repository '%s' as a mirror '%s'", repo.sha, repo.URL, repo.mirrorURL) var serr bytes.Buffer _, err := (*repo.executor).ExecGitCommand( - []string{"push", "--mirror", repo.mirrorURL}, + []string{"push", gitFlagMirror, repo.mirrorURL}, nil, &serr, repo.fullPath, @@ -327,7 +339,7 @@ func (repo *Repo) Clone() bool { log.Infof("%s: Clone repository '%s'", repo.sha, repo.URL) var serr bytes.Buffer _, err := (*repo.executor).ExecGitCommand( - []string{"clone", "--branch", repo.Ref, repo.URL, repo.fullPath}, + []string{gitCmdClone, gitFlagBranch, repo.Ref, repo.URL, repo.fullPath}, nil, &serr, "", @@ -345,7 +357,7 @@ func (repo *Repo) ShallowClone() bool { log.Infof("%s: Clone repository '%s'", repo.sha, repo.URL) var serr bytes.Buffer _, err := (*repo.executor).ExecGitCommand( - []string{"clone", "--depth", "1", "--branch", repo.Ref, repo.URL, repo.fullPath}, + []string{gitCmdClone, "--depth", "1", gitFlagBranch, repo.Ref, repo.URL, repo.fullPath}, nil, &serr, "", @@ -373,18 +385,18 @@ func (repo *Repo) RemoveTargetDir(dotGit bool) { } func (repo *Repo) IsClean() bool { - _, err := (*repo.executor).ExecGitCommand([]string{"diff", "--quiet"}, nil, nil, repo.fullPath) + _, err := (*repo.executor).ExecGitCommand([]string{gitCmdDiff, gitFlagQuiet}, nil, nil, repo.fullPath) if err != nil { return false } - _, err = (*repo.executor).ExecGitCommand([]string{"diff", "--staged", "--quiet"}, nil, nil, repo.fullPath) + _, err = (*repo.executor).ExecGitCommand([]string{gitCmdDiff, "--staged", gitFlagQuiet}, nil, nil, repo.fullPath) return err == nil } func (repo *Repo) IsCurrentBranchRef() bool { var outb, errb bytes.Buffer _, err := (*repo.executor).ExecGitCommand( - []string{"rev-parse", "--abbrev-ref", "HEAD"}, + []string{gitCmdRevParse, gitFlagAbbrevRef, gitRefHEAD}, &outb, &errb, repo.fullPath, @@ -398,7 +410,7 @@ func (repo *Repo) IsCurrentBranchRef() bool { func (repo *Repo) GetCurrentBranch() string { var outb, errb bytes.Buffer _, err := (*repo.executor).ExecGitCommand( - []string{"rev-parse", "--abbrev-ref", "HEAD"}, + []string{gitCmdRevParse, gitFlagAbbrevRef, gitRefHEAD}, &outb, &errb, repo.fullPath, @@ -413,7 +425,7 @@ func (repo *Repo) GetCurrentBranch() string { func (repo *Repo) GitStashSave() bool { log.Infof("%s: Stash unsaved changes", repo.sha) var serr bytes.Buffer - _, err := (*repo.executor).ExecGitCommand([]string{"stash", "save"}, nil, &serr, repo.fullPath) + _, err := (*repo.executor).ExecGitCommand([]string{gitCmdStash, "save"}, nil, &serr, repo.fullPath) if err != nil { repo.status.Error = true log.Warnf("%s: %v: %v", repo.sha, err, serr.String()) @@ -425,7 +437,7 @@ func (repo *Repo) GitStashSave() bool { func (repo *Repo) GitStashPop() bool { log.Infof("%s: Restore stashed changes", repo.sha) var serr bytes.Buffer - _, err := (*repo.executor).ExecGitCommand([]string{"stash", "pop"}, nil, &serr, repo.fullPath) + _, err := (*repo.executor).ExecGitCommand([]string{gitCmdStash, "pop"}, nil, &serr, repo.fullPath) if err != nil { repo.status.Error = true log.Warnf("%s: %v: %v", repo.sha, err, serr.String()) @@ -438,7 +450,7 @@ func (repo *Repo) GitStashPop() bool { func (repo *Repo) IsRefBranch() bool { fullRef := fmt.Sprintf("refs/heads/%s", repo.Ref) _, err := (*repo.executor).ExecGitCommand( - []string{"show-ref", "--quiet", "--verify", fullRef}, + []string{gitCmdShowRef, gitFlagQuiet, gitFlagVerify, fullRef}, nil, nil, repo.fullPath, @@ -449,7 +461,7 @@ func (repo *Repo) IsRefBranch() bool { func (repo *Repo) IsRefTag() bool { fullRef := fmt.Sprintf("refs/tags/%s", repo.Ref) _, err := (*repo.executor).ExecGitCommand( - []string{"show-ref", "--quiet", "--verify", fullRef}, + []string{gitCmdShowRef, gitFlagQuiet, gitFlagVerify, fullRef}, nil, nil, repo.fullPath, @@ -842,7 +854,7 @@ func GetRepositories( fmt.Fprintln(w) fmt.Fprintln(w, "REPOSITORY\tPATH\tLOCAL_CHANGES\tNOT_ON_REF\tERROR\tSKIPPED\tCLEAN") for _, repo := range *repoList { - clean := !(!repo.status.Processed || repo.status.UncommittedChanges || repo.status.NotOnRefBranch || repo.status.Error) + clean := repo.status.Processed && !repo.status.UncommittedChanges && !repo.status.NotOnRefBranch && !repo.status.Error if repo.status.Processed { fmt.Fprintf(w, "%s\t%s\t%t\t%t\t%t\t%t\t%t\n", repo.URL, @@ -1087,7 +1099,7 @@ func writeReposToFile(repoSha, cfgFile string, repoList []Repo) { // if these are existing and returns list of repositories, if any file // is missing - it fails func GetConfigRepoList(cfgFiles []string) *RepoList { - var mergedRepoList []Repo + mergedRepoList := make([]Repo, 0, len(cfgFiles)) for _, cfgFile := range cfgFiles { var singleRepoList []Repo yamlFile, err := os.ReadFile(cfgFile) diff --git a/gitget/get_test.go b/gitget/get_test.go index efec9f5..df98a2b 100644 --- a/gitget/get_test.go +++ b/gitget/get_test.go @@ -14,6 +14,19 @@ import ( "github.com/stretchr/testify/assert" ) +const ( + testAltName = "abc" + testAltNameCde = "cde" + testFullPathP = "cde_p" + testFullPathA = "cde_a" + testName1 = "test 1" + testName2 = "test 2" + testRefMaster = "master" + testRefDevelop = "develop" + testShaVal = "abcabc" + testRepoURL = "https://github.com/user/repo.git" +) + var repoUrls = map[string]string{ "https://github.com/ansible/ansible.git": "ansible", "git@github.com:ansible/ansible.git": "ansible", @@ -28,7 +41,7 @@ func Test_SetDefaultRef(t *testing.T) { // Test setting to default if not specified repo.SetDefaultRef() - assert.Equal(t, "master", repo.Ref) + assert.Equal(t, testRefMaster, repo.Ref) // Test that if already set - setting to default has no effect repo.Ref = "trunk" @@ -47,9 +60,9 @@ func Test_GetRepoLocalName(t *testing.T) { } repo := Repo{} - repo.AltName = "abc" + repo.AltName = testAltName altname = repo.GetRepoLocalName() - assert.Equal(t, "abc", altname) + assert.Equal(t, testAltName, altname) } func Test_SetRepoLocalName(t *testing.T) { @@ -61,15 +74,15 @@ func Test_SetRepoLocalName(t *testing.T) { } repo := Repo{} - repo.AltName = "abc" + repo.AltName = testAltName repo.SetRepoLocalName() - assert.Equal(t, "abc", repo.AltName) + assert.Equal(t, testAltName, repo.AltName) } func Test_SetSha(t *testing.T) { repo := Repo{} repo.URL = "git@github.com:johndoe/git-get.git" - repo.Ref = "master" + repo.Ref = testRefMaster repo.fullPath = "/Users/johndoe/workspace/john/git-get/git-get" repo.SetSha() @@ -89,9 +102,9 @@ func Test_PathExists(t *testing.T) { func Test_SetRepoFullPath(t *testing.T) { repo := Repo{ Path: "qqq", - AltName: "abc", + AltName: testAltName, } - expectedFullPath := path.Join("qqq", "abc") + expectedFullPath := path.Join("qqq", testAltName) repo.SetRepoFullPath() assert.Equal(t, expectedFullPath, repo.fullPath) @@ -118,8 +131,8 @@ func Test_generateSha(t *testing.T) { } testCases := []testCase{ - {name: "test 1", repoInfo: "Some string here", expectedResult: "21e5963"}, - {name: "test 2", repoInfo: "Another string here", expectedResult: "04d5c8f"}, + {name: testName1, repoInfo: "Some string here", expectedResult: "21e5963"}, + {name: testName2, repoInfo: "Another string here", expectedResult: "04d5c8f"}, } for _, tc := range testCases { @@ -139,10 +152,10 @@ func Test_SetMirrorURL(t *testing.T) { } testCases := []testCase{ - {name: "test repo abc", expectedResult: "abc/abc.git", repo: Repo{AltName: "abc"}, mirrorRootURL: "abc"}, - {name: "test repo qqq", expectedResult: "abc/qqq/cde.git", repo: Repo{AltName: "cde"}, mirrorRootURL: "abc/qqq"}, - {name: "test repo http://qqq", expectedResult: "http://qqq/cde.git", repo: Repo{AltName: "cde"}, mirrorRootURL: "http://qqq"}, - {name: "test repo git@qqq", expectedResult: "git@qqq/cde.git", repo: Repo{AltName: "cde"}, mirrorRootURL: "git@qqq"}, + {name: "test repo abc", expectedResult: "abc/abc.git", repo: Repo{AltName: testAltName}, mirrorRootURL: testAltName}, + {name: "test repo qqq", expectedResult: "abc/qqq/cde.git", repo: Repo{AltName: testAltNameCde}, mirrorRootURL: "abc/qqq"}, + {name: "test repo http://qqq", expectedResult: "http://qqq/cde.git", repo: Repo{AltName: testAltNameCde}, mirrorRootURL: "http://qqq"}, + {name: "test repo git@qqq", expectedResult: "git@qqq/cde.git", repo: Repo{AltName: testAltNameCde}, mirrorRootURL: "git@qqq"}, } for _, tc := range testCases { @@ -162,8 +175,8 @@ func Test_Repo_IsRefTag(t *testing.T) { } testCases := []testCase{ - {name: "test 1", expectedResult: true, repo: Repo{Ref: "abc", fullPath: "cde_p"}, returnError: nil}, - {name: "test 2", expectedResult: false, repo: Repo{Ref: "cde", fullPath: "cde_a"}, returnError: fmt.Errorf("test error")}, + {name: testName1, expectedResult: true, repo: Repo{Ref: testAltName, fullPath: testFullPathP}, returnError: nil}, + {name: testName2, expectedResult: false, repo: Repo{Ref: testAltNameCde, fullPath: testFullPathA}, returnError: fmt.Errorf("test error")}, } for _, tc := range testCases { @@ -173,7 +186,7 @@ func Test_Repo_IsRefTag(t *testing.T) { mockGitExec.On( "ExecGitCommand", - []string{"show-ref", "--quiet", "--verify", fmt.Sprintf("refs/tags/%s", tc.repo.Ref)}, + []string{gitCmdShowRef, gitFlagQuiet, gitFlagVerify, fmt.Sprintf("refs/tags/%s", tc.repo.Ref)}, (*bytes.Buffer)(nil), (*bytes.Buffer)(nil), tc.repo.fullPath).Return(exe, tc.returnError) @@ -195,8 +208,8 @@ func Test_Repo_IsRefBranch(t *testing.T) { } testCases := []testCase{ - {name: "test 1", expectedResult: true, repo: Repo{Ref: "abc", fullPath: "cde_p"}, returnError: nil}, - {name: "test 2", expectedResult: false, repo: Repo{Ref: "cde", fullPath: "cde_a"}, returnError: fmt.Errorf("test error")}, + {name: testName1, expectedResult: true, repo: Repo{Ref: testAltName, fullPath: testFullPathP}, returnError: nil}, + {name: testName2, expectedResult: false, repo: Repo{Ref: testAltNameCde, fullPath: testFullPathA}, returnError: fmt.Errorf("test error")}, } for _, tc := range testCases { @@ -206,7 +219,7 @@ func Test_Repo_IsRefBranch(t *testing.T) { mockGitExec.On( "ExecGitCommand", - []string{"show-ref", "--quiet", "--verify", fmt.Sprintf("refs/heads/%s", tc.repo.Ref)}, + []string{gitCmdShowRef, gitFlagQuiet, gitFlagVerify, fmt.Sprintf("refs/heads/%s", tc.repo.Ref)}, (*bytes.Buffer)(nil), (*bytes.Buffer)(nil), tc.repo.fullPath).Return(exe, tc.returnError) @@ -228,8 +241,8 @@ func Test_Repo_GitStashPop(t *testing.T) { } testCases := []testCase{ - {name: "test 1", expectedResult: true, repo: Repo{}, returnError: nil}, - {name: "test 2", expectedResult: false, repo: Repo{}, returnError: fmt.Errorf("test error")}, + {name: testName1, expectedResult: true, repo: Repo{}, returnError: nil}, + {name: testName2, expectedResult: false, repo: Repo{}, returnError: fmt.Errorf("test error")}, } for _, tc := range testCases { @@ -240,7 +253,7 @@ func Test_Repo_GitStashPop(t *testing.T) { mockGitExec.On( "ExecGitCommand", - []string{"stash", "pop"}, + []string{gitCmdStash, "pop"}, (*bytes.Buffer)(nil), serr, tc.repo.fullPath).Return(exe, tc.returnError) @@ -263,8 +276,8 @@ func Test_Repo_GitStashSave(t *testing.T) { } testCases := []testCase{ - {name: "test 1", expectedResult: true, repo: Repo{}, returnError: nil}, - {name: "test 2", expectedResult: false, repo: Repo{}, returnError: fmt.Errorf("test error")}, + {name: testName1, expectedResult: true, repo: Repo{}, returnError: nil}, + {name: testName2, expectedResult: false, repo: Repo{}, returnError: fmt.Errorf("test error")}, } for _, tc := range testCases { @@ -275,7 +288,7 @@ func Test_Repo_GitStashSave(t *testing.T) { mockGitExec.On( "ExecGitCommand", - []string{"stash", "save"}, + []string{gitCmdStash, "save"}, (*bytes.Buffer)(nil), serr, tc.repo.fullPath).Return(exe, tc.returnError) @@ -298,8 +311,8 @@ func Test_Repo_CloneMirror(t *testing.T) { } testCases := []testCase{ - {name: "test 1", expectedResult: true, repo: Repo{URL: "cde", fullPath: "cde_a"}, returnError: nil}, - {name: "test 2", expectedResult: false, repo: Repo{URL: "cde", fullPath: "cde_a"}, returnError: fmt.Errorf("test error")}, + {name: testName1, expectedResult: true, repo: Repo{URL: testAltNameCde, fullPath: testFullPathA}, returnError: nil}, + {name: testName2, expectedResult: false, repo: Repo{URL: testAltNameCde, fullPath: testFullPathA}, returnError: fmt.Errorf("test error")}, } for _, tc := range testCases { @@ -310,7 +323,7 @@ func Test_Repo_CloneMirror(t *testing.T) { mockGitExec.On( "ExecGitCommand", - []string{"clone", "--mirror", tc.repo.URL, tc.repo.fullPath}, + []string{gitCmdClone, gitFlagMirror, tc.repo.URL, tc.repo.fullPath}, (*bytes.Buffer)(nil), serr, "").Return(exe, tc.returnError) @@ -333,8 +346,8 @@ func Test_Repo_GetCurrentBranch(t *testing.T) { testCases := []testCase{ // Have not found a way to mutate `outb` at mock call invocation time to validate against `expectedResult` - {name: "test 1", expectedResult: "", repo: Repo{fullPath: "cde_a"}, returnError: nil}, - {name: "test 2", expectedResult: "", repo: Repo{fullPath: "cde_a"}, returnError: fmt.Errorf("test error")}, + {name: testName1, expectedResult: "", repo: Repo{fullPath: testFullPathA}, returnError: nil}, + {name: testName2, expectedResult: "", repo: Repo{fullPath: testFullPathA}, returnError: fmt.Errorf("test error")}, } for _, tc := range testCases { @@ -345,7 +358,7 @@ func Test_Repo_GetCurrentBranch(t *testing.T) { mockGitExec.On( "ExecGitCommand", - []string{"rev-parse", "--abbrev-ref", "HEAD"}, + []string{gitCmdRevParse, gitFlagAbbrevRef, gitRefHEAD}, &outb, &errb, tc.repo.fullPath).Return(exe, tc.returnError) @@ -370,19 +383,19 @@ func Test_Repo_IsClean(t *testing.T) { testCases := []testCase{ { name: "test 1: no error", expectedResult: true, - repo: Repo{fullPath: "cde_p"}, err1: nil, err2: nil, + repo: Repo{fullPath: testFullPathP}, err1: nil, err2: nil, }, { name: "test 2: err1 raised", expectedResult: false, - repo: Repo{fullPath: "cde_a"}, err1: fmt.Errorf("test error"), err2: nil, + repo: Repo{fullPath: testFullPathA}, err1: fmt.Errorf("test error"), err2: nil, }, { name: "test 3: err2 raised", expectedResult: false, - repo: Repo{fullPath: "cde_a"}, err1: nil, err2: fmt.Errorf("test error"), + repo: Repo{fullPath: testFullPathA}, err1: nil, err2: fmt.Errorf("test error"), }, { name: "test 3: err1 and err2 can be raised", expectedResult: false, - repo: Repo{fullPath: "cde_a"}, err1: fmt.Errorf("test error"), err2: fmt.Errorf("test error"), + repo: Repo{fullPath: testFullPathA}, err1: fmt.Errorf("test error"), err2: fmt.Errorf("test error"), }, } @@ -393,13 +406,13 @@ func Test_Repo_IsClean(t *testing.T) { mockGitExec.On( "ExecGitCommand", - []string{"diff", "--quiet"}, + []string{gitCmdDiff, gitFlagQuiet}, (*bytes.Buffer)(nil), (*bytes.Buffer)(nil), tc.repo.fullPath).Return(exe, tc.err1) mockGitExec.On( "ExecGitCommand", - []string{"diff", "--staged", "--quiet"}, + []string{gitCmdDiff, "--staged", gitFlagQuiet}, (*bytes.Buffer)(nil), (*bytes.Buffer)(nil), tc.repo.fullPath).Return(exe, tc.err2) @@ -421,8 +434,8 @@ func Test_Repo_ShallowClone(t *testing.T) { } testCases := []testCase{ - {name: "test 1", expectedResult: true, repo: Repo{Ref: "abc", URL: "cde", fullPath: "cde_a"}, returnError: nil}, - {name: "test 2", expectedResult: false, repo: Repo{Ref: "abc", URL: "cde", fullPath: "cde_a"}, returnError: fmt.Errorf("test error")}, + {name: testName1, expectedResult: true, repo: Repo{Ref: testAltName, URL: testAltNameCde, fullPath: testFullPathA}, returnError: nil}, + {name: testName2, expectedResult: false, repo: Repo{Ref: testAltName, URL: testAltNameCde, fullPath: testFullPathA}, returnError: fmt.Errorf("test error")}, } for _, tc := range testCases { @@ -433,7 +446,7 @@ func Test_Repo_ShallowClone(t *testing.T) { mockGitExec.On( "ExecGitCommand", - []string{"clone", "--depth", "1", "--branch", tc.repo.Ref, tc.repo.URL, tc.repo.fullPath}, + []string{gitCmdClone, "--depth", "1", gitFlagBranch, tc.repo.Ref, tc.repo.URL, tc.repo.fullPath}, (*bytes.Buffer)(nil), serr, "").Return(exe, tc.returnError) @@ -455,8 +468,8 @@ func Test_Repo_Clone(t *testing.T) { } testCases := []testCase{ - {name: "test 1", expectedResult: true, repo: Repo{Ref: "abc", URL: "cde", fullPath: "cde_a"}, returnError: nil}, - {name: "test 2", expectedResult: false, repo: Repo{Ref: "abc", URL: "cde", fullPath: "cde_a"}, returnError: fmt.Errorf("test error")}, + {name: testName1, expectedResult: true, repo: Repo{Ref: testAltName, URL: testAltNameCde, fullPath: testFullPathA}, returnError: nil}, + {name: testName2, expectedResult: false, repo: Repo{Ref: testAltName, URL: testAltNameCde, fullPath: testFullPathA}, returnError: fmt.Errorf("test error")}, } for _, tc := range testCases { @@ -467,7 +480,7 @@ func Test_Repo_Clone(t *testing.T) { mockGitExec.On( "ExecGitCommand", - []string{"clone", "--branch", tc.repo.Ref, tc.repo.URL, tc.repo.fullPath}, + []string{gitCmdClone, gitFlagBranch, tc.repo.Ref, tc.repo.URL, tc.repo.fullPath}, (*bytes.Buffer)(nil), serr, "").Return(exe, tc.returnError) @@ -489,8 +502,8 @@ func Test_Repo_PushMirror(t *testing.T) { } testCases := []testCase{ - {name: "test 1", expectedResult: true, repo: Repo{mirrorURL: "cde"}, returnError: nil}, - {name: "test 2", expectedResult: false, repo: Repo{mirrorURL: "cde"}, returnError: fmt.Errorf("test error")}, + {name: testName1, expectedResult: true, repo: Repo{mirrorURL: testAltNameCde}, returnError: nil}, + {name: testName2, expectedResult: false, repo: Repo{mirrorURL: testAltNameCde}, returnError: fmt.Errorf("test error")}, } for _, tc := range testCases { @@ -501,7 +514,7 @@ func Test_Repo_PushMirror(t *testing.T) { mockGitExec.On( "ExecGitCommand", - []string{"push", "--mirror", tc.repo.mirrorURL}, + []string{"push", gitFlagMirror, tc.repo.mirrorURL}, (*bytes.Buffer)(nil), serr, "").Return(exe, tc.returnError) @@ -526,35 +539,35 @@ func Test_Repo_GitCheckout(t *testing.T) { testCases := []testCase{ { - name: "test 1", + name: testName1, expectedResult: true, expectedNotOnRefBranch: false, - branch: "develop", - repo: Repo{sha: "abcabc", Ref: "develop", fullPath: "abc"}, + branch: testRefDevelop, + repo: Repo{sha: testShaVal, Ref: testRefDevelop, fullPath: testAltName}, returnError: nil, }, { - name: "test 2", + name: testName2, expectedResult: false, expectedNotOnRefBranch: false, - branch: "develop", - repo: Repo{sha: "abcabc", Ref: "develop", fullPath: "abc"}, + branch: testRefDevelop, + repo: Repo{sha: testShaVal, Ref: testRefDevelop, fullPath: testAltName}, returnError: fmt.Errorf("test error"), }, { name: "test 3", expectedResult: true, expectedNotOnRefBranch: true, - branch: "master", - repo: Repo{sha: "abcabc", Ref: "develop", fullPath: "abc"}, + branch: testRefMaster, + repo: Repo{sha: testShaVal, Ref: testRefDevelop, fullPath: testAltName}, returnError: nil, }, { name: "test 4", expectedResult: false, expectedNotOnRefBranch: true, - branch: "master", - repo: Repo{sha: "abcabc", Ref: "develop", fullPath: "abc"}, + branch: testRefMaster, + repo: Repo{sha: testShaVal, Ref: testRefDevelop, fullPath: testAltName}, returnError: fmt.Errorf("test error"), }, } @@ -595,26 +608,26 @@ func Test_IgnoreThisRepo(t *testing.T) { testCases := []testCase{ { name: "repo not in ignore list", - repoURL: "https://github.com/user/repo.git", + repoURL: testRepoURL, ignoreList: []Repo{{URL: "https://github.com/other/repo.git"}}, expectedResult: false, }, { name: "repo in ignore list", - repoURL: "https://github.com/user/repo.git", - ignoreList: []Repo{{URL: "https://github.com/user/repo.git"}}, + repoURL: testRepoURL, + ignoreList: []Repo{{URL: testRepoURL}}, expectedResult: true, }, { name: "empty ignore list", - repoURL: "https://github.com/user/repo.git", + repoURL: testRepoURL, ignoreList: []Repo{}, expectedResult: false, }, { name: "multiple repos in ignore list", - repoURL: "https://github.com/user/repo.git", - ignoreList: []Repo{{URL: "https://github.com/other/repo.git"}, {URL: "https://github.com/user/repo.git"}}, + repoURL: testRepoURL, + ignoreList: []Repo{{URL: "https://github.com/other/repo.git"}, {URL: testRepoURL}}, expectedResult: true, }, } @@ -637,7 +650,7 @@ func Test_Repo_SetShellRunner(t *testing.T) { func Test_Repo_PrepareForGet(t *testing.T) { repo := Repo{ - URL: "https://github.com/user/repo.git", + URL: testRepoURL, Ref: "main", } diff --git a/github/github.go b/github/github.go index cddf41e..528ec50 100644 --- a/github/github.go +++ b/github/github.go @@ -28,7 +28,7 @@ import ( "fmt" "os" - "github.com/google/go-github/v81/github" + "github.com/google/go-github/v88/github" log "github.com/sirupsen/logrus" "golang.org/x/oauth2" ) @@ -69,7 +69,10 @@ func (gitProvider *GitGetGithub) auth(ctx context.Context, repositorySha string) &oauth2.Token{AccessToken: gitProvider.token}, ) tc := oauth2.NewClient(ctx, ts) - git := github.NewClient(tc) + git, err := github.NewClient(github.WithHTTPClient(tc)) + if err != nil { + log.Fatalf("Error creating GitHub client: %v", err) + } return git } @@ -99,11 +102,7 @@ func (gitProvider *GitGetGithub) CreateRepository( sourceURL string, ) *github.Repository { git := gitProvider.auth(ctx, repositorySha) - isPrivate := true - - if mirrorVisibilityMode == "public" { - isPrivate = false - } + isPrivate := mirrorVisibilityMode != "public" repoDef := &github.Repository{ Name: github.Ptr(repository), @@ -154,7 +153,7 @@ func fetchOrgRepos( "%s: NextPage/PrevPage/FirstPage/LastPage '%d/%d/%d/%d'\n", repoSha, res.NextPage, res.PrevPage, res.FirstPage, res.LastPage) for repo := 0; repo < len(repos); repo++ { - log.Debugf("%s: (%d) Repo FullName '%s'", repoSha, opts.ListOptions.Page, *repos[repo].FullName) + log.Debugf("%s: (%d) Repo FullName '%s'", repoSha, opts.Page, *repos[repo].FullName) } repoList = append(repoList, repos...) log.Debugf("%s: Found '%d' repositories owned by '%s'", repoSha, len(repos), owner) @@ -201,7 +200,7 @@ func fetchUserRepos( "%s: NextPage/PrevPage/FirstPage/LastPage '%d/%d/%d/%d'\n", repoSha, res.NextPage, res.PrevPage, res.FirstPage, res.LastPage) for repo := 0; repo < len(repos); repo++ { - log.Debugf("%s: (%d) Repo FullName '%s'", repoSha, opts.ListOptions.Page, *repos[repo].FullName) + log.Debugf("%s: (%d) Repo FullName '%s'", repoSha, opts.Page, *repos[repo].FullName) } repoList = append(repoList, repos...) log.Debugf("%s: Found '%d' repositories owned by '%s'", repoSha, len(repos), owner) diff --git a/github/github_test.go b/github/github_test.go index 3f0a6f5..3cbb014 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -8,7 +8,7 @@ import ( "os" "testing" - "github.com/google/go-github/v81/github" + "github.com/google/go-github/v88/github" "github.com/stretchr/testify/assert" ) diff --git a/github/mocks/mocks.go b/github/mocks/mocks.go index 6a3dd27..b143d93 100644 --- a/github/mocks/mocks.go +++ b/github/mocks/mocks.go @@ -7,7 +7,7 @@ package mocks import ( "context" - "github.com/google/go-github/v81/github" + "github.com/google/go-github/v88/github" mock "github.com/stretchr/testify/mock" ) diff --git a/gitlab/gitlab.go b/gitlab/gitlab.go index 63e69c7..a5970bd 100644 --- a/gitlab/gitlab.go +++ b/gitlab/gitlab.go @@ -278,7 +278,7 @@ func (gitProvider *GitGetGitlab) processSubgroups( for { log.Debugf( "%s: Fetching group '%d:%s' subgroups - page '%d'", - repoSha, groupID, groupName, subGrpOpt.ListOptions.Page) + repoSha, groupID, groupName, subGrpOpt.Page) groups, res, err := git.Groups.ListSubGroups(groupID, subGrpOpt, nil) if err != nil { log.Errorf( diff --git a/go.mod b/go.mod index 5802a3f..22f80e3 100644 --- a/go.mod +++ b/go.mod @@ -2,27 +2,25 @@ module github.com/isindir/git-get // UPDATE_HERE // https://go.dev/dl/ -go 1.25.5 +go 1.26.4 require ( // https://github.com/fatih/color/releases - github.com/fatih/color v1.18.0 + github.com/fatih/color v1.19.0 // https://github.com/google/go-github/releases - github.com/google/go-github/v81 v81.0.0 + github.com/google/go-github/v88 v88.0.0 // https://github.com/ktrysmt/go-bitbucket/releases - github.com/ktrysmt/go-bitbucket v0.9.88 + github.com/ktrysmt/go-bitbucket v0.10.0 // https://github.com/sirupsen/logrus/releases - github.com/sirupsen/logrus v1.9.3 + github.com/sirupsen/logrus v1.9.4 // https://github.com/spf13/cobra/releases github.com/spf13/cobra v1.10.2 // https://github.com/stretchr/testify/releases github.com/stretchr/testify v1.11.1 // https://gitlab.com/gitlab-org/api/client-go/-/releases - gitlab.com/gitlab-org/api/client-go v1.11.0 - // https://pkg.go.dev/golang.org/x/net - golang.org/x/net v0.48.0 // indirect + gitlab.com/gitlab-org/api/client-go v1.46.0 // https://pkg.go.dev/golang.org/x/oauth2 - golang.org/x/oauth2 v0.34.0 + golang.org/x/oauth2 v0.36.0 // https://gopkg.in/yaml.v3 gopkg.in/yaml.v3 v3.0.1 ) @@ -34,12 +32,13 @@ require ( github.com/hashicorp/go-retryablehttp v0.7.8 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/kr/text v0.2.0 // indirect - github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mattn/go-colorable v0.1.15 // indirect + github.com/mattn/go-isatty v0.0.22 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/spf13/pflag v1.0.9 // indirect + github.com/spf13/pflag v1.0.10 // indirect github.com/stretchr/objx v0.5.2 // indirect - golang.org/x/sys v0.39.0 // indirect - golang.org/x/time v0.14.0 // indirect + golang.org/x/net v0.56.0 // indirect + golang.org/x/sys v0.46.0 // indirect + golang.org/x/time v0.15.0 // indirect ) diff --git a/go.sum b/go.sum index 9b6ecf7..e8df518 100644 --- a/go.sum +++ b/go.sum @@ -1,17 +1,18 @@ github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= -github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= +github.com/fatih/color v1.19.0 h1:Zp3PiM21/9Ld6FzSKyL5c/BULoe/ONr9KlbYVOfG8+w= +github.com/fatih/color v1.19.0/go.mod h1:zNk67I0ZUT1bEGsSGyCZYZNrHuTkJJB+r6Q9VuMi0LE= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/google/go-github/v81 v81.0.0 h1:hTLugQRxSLD1Yei18fk4A5eYjOGLUBKAl/VCqOfFkZc= -github.com/google/go-github/v81 v81.0.0/go.mod h1:upyjaybucIbBIuxgJS7YLOZGziyvvJ92WX6WEBNE3sM= +github.com/google/go-github/v88 v88.0.0 h1:dZA9IKkPK1eXZj4ypngnpRj5FwdpTv4whix2PrQMP7M= +github.com/google/go-github/v88 v88.0.0/go.mod h1:rufTDgn2N45wjhukLTyxmvc9nilSp3mr3Rgtt6b1MPw= github.com/google/go-querystring v1.2.0 h1:yhqkPbu2/OH+V9BfpCVPZkNmUXhb2gBxJArfhIxNtP0= github.com/google/go-querystring v1.2.0/go.mod h1:8IFJqpSRITyJ8QhQ13bmbeMBDfmeEJZD5A0egEOmkqU= +github.com/graph-gophers/graphql-go v1.9.0 h1:yu0ucKHLc5qGpRwLYKIWtr9bOoxovkWasuBrPQwlHls= +github.com/graph-gophers/graphql-go v1.9.0/go.mod h1:23olKZ7duEvHlF/2ELEoSZaY1aNPfShjP782SOoNTyM= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= @@ -24,13 +25,12 @@ github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/ktrysmt/go-bitbucket v0.9.88 h1:XBjYui83tW2puG7f2GvYSAMMKIPfhpeoLCVfEJx3KVM= -github.com/ktrysmt/go-bitbucket v0.9.88/go.mod h1:fx6zdyKEyiNfR9VW0npWD6ugoSUsp8JLXGyqna8bHkc= -github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= -github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= -github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/ktrysmt/go-bitbucket v0.10.0 h1:miXSfqFb+j0pPBB9h8kw9f/oeq045WOPI4hplr996+k= +github.com/ktrysmt/go-bitbucket v0.10.0/go.mod h1:IUB8I+gC3UO00NjNTMS7STjsZYq+EAhPuHgynzRWxqY= +github.com/mattn/go-colorable v0.1.15 h1:+u9SLTRGnXv73cEsnsmoZBom+dMU88B2M0aDcWy0/jY= +github.com/mattn/go-colorable v0.1.15/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= +github.com/mattn/go-isatty v0.0.22 h1:j8l17JJ9i6VGPUFUYoTUKPSgKe/83EYU2zBC7YNKMw4= +github.com/mattn/go-isatty v0.0.22/go.mod h1:ZXfXG4SQHsB/w3ZeOYbR0PrPwLy+n6xiMrJlRFqopa4= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -38,35 +38,30 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= -github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/sirupsen/logrus v1.9.4 h1:TsZE7l11zFCLZnZ+teH4Umoq5BhEIfIzfRDZ1Uzql2w= +github.com/sirupsen/logrus v1.9.4/go.mod h1:ftWc9WdOfJ0a92nsE2jF5u5ZwH8Bv2zdeOC42RjbV2g= github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU= github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4= -github.com/spf13/pflag v1.0.9 h1:9exaQaMOCwffKiiiYk6/BndUBv+iRViNW+4lEMi0PvY= github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= +github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= -gitlab.com/gitlab-org/api/client-go v1.11.0 h1:L+qzw4kiCf3jKdKHQAwiqYKITvzBrW/tl8ampxNLlv0= -gitlab.com/gitlab-org/api/client-go v1.11.0/go.mod h1:adtVJ4zSTEJ2fP5Pb1zF4Ox1OKFg0MH43yxpb0T0248= +gitlab.com/gitlab-org/api/client-go v1.46.0 h1:YxBWFZIFYKcGESCb9fpkwzouo+apyB9pr/XTWzNoL24= +gitlab.com/gitlab-org/api/client-go v1.46.0/go.mod h1:FtgyU6g2HS5+fMhw6nLK96GBEEBx5MzntOiJWfIaiN8= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= -golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU= -golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY= -golang.org/x/oauth2 v0.34.0 h1:hqK/t4AKgbqWkdkcAeI8XLmbK+4m4G5YeQRrmiotGlw= -golang.org/x/oauth2 v0.34.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk= -golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= -golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI= -golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4= +golang.org/x/net v0.56.0 h1:Rw8j/hFzGvJUZwNBXnAtf5sVDVt+65SK2C7IxCxZt5o= +golang.org/x/net v0.56.0/go.mod h1:D3Ku6r+V6JROoZK144D2XfMHFcMq/0zSfLelVTCFKec= +golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= +golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= +golang.org/x/sys v0.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw= +golang.org/x/sys v0.46.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U= +golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=