From f7865fc3d6b27fa1c9925d020f928bfd5689da23 Mon Sep 17 00:00:00 2001 From: Christopher Hunter Date: Thu, 31 Aug 2023 10:47:43 -0700 Subject: [PATCH 1/2] bump (go-pivnet): import v7 everywhere dependabot is not bumping major versions so I am doing it manually --- go.mod | 1 - go.sum | 2 -- .../fakes/pivnet_product_files_service.go | 2 +- .../pivnet_release_dependencies_service.go | 2 +- .../pivnet_release_upgrade_paths_service.go | 2 +- .../commands/fakes/pivnet_releases_service.go | 20 ++++++++++--------- .../fakes/pivnet_user_groups_service.go | 2 +- internal/commands/publish.go | 6 +++--- internal/commands/publish_test.go | 2 +- 9 files changed, 19 insertions(+), 20 deletions(-) diff --git a/go.mod b/go.mod index 688714c2f..7edc4c8aa 100644 --- a/go.mod +++ b/go.mod @@ -31,7 +31,6 @@ require ( github.com/onsi/gomega v1.18.1 github.com/opencontainers/image-spec v1.0.3-0.20220303224323-02efb9a75ee1 github.com/pivotal-cf-experimental/gomegamatchers v0.0.0-20180326192815-e36bfcc98c3a - github.com/pivotal-cf/go-pivnet/v2 v2.0.11 github.com/pivotal-cf/go-pivnet/v7 v7.0.2 github.com/pivotal-cf/jhanda v0.0.0-20200619200912-8de8eb943a43 github.com/pivotal-cf/om v0.0.0-20211027143906-30b10602e528 diff --git a/go.sum b/go.sum index 67f854a90..aee717126 100644 --- a/go.sum +++ b/go.sum @@ -627,8 +627,6 @@ github.com/pierrec/lz4 v2.6.0+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi github.com/pivotal-cf-experimental/gomegamatchers v0.0.0-20180326192815-e36bfcc98c3a h1:K20a2viyp6kZgY41ESLne0eOXyY9DarmwA4q6zQ686w= github.com/pivotal-cf-experimental/gomegamatchers v0.0.0-20180326192815-e36bfcc98c3a/go.mod h1:HdFegZwXOoRNyrqaOX6FC1zMkbA2k1/ktb2anj1E0K8= github.com/pivotal-cf/go-pivnet v1.0.3/go.mod h1:rvEzWli4NJQhX7Z3z0DiEQXsPwC+uE//eIKcpl7S1as= -github.com/pivotal-cf/go-pivnet/v2 v2.0.11 h1:6tzC4zOr7acFPevfP32+8rEU567JlDobqiIejFf8aOc= -github.com/pivotal-cf/go-pivnet/v2 v2.0.11/go.mod h1:Ormn4YO2MooU40LNFwECoLd8XZFwbRcysET+OAn7FLg= github.com/pivotal-cf/go-pivnet/v6 v6.0.2/go.mod h1:ymI4gZvp8lf3GNaf1Re+JRV18zU0w8TLBDQB/t8SaFs= github.com/pivotal-cf/go-pivnet/v7 v7.0.2 h1:8IYUIXmFEJpuTSIuOM5K4z0tJLPULDPpKJfn+wWLhqk= github.com/pivotal-cf/go-pivnet/v7 v7.0.2/go.mod h1:h868WmuLUuavwNHoC6FyGI3hK/6rP3/HCmM8sYLuC8c= diff --git a/internal/commands/fakes/pivnet_product_files_service.go b/internal/commands/fakes/pivnet_product_files_service.go index dd7484452..c44233ca9 100644 --- a/internal/commands/fakes/pivnet_product_files_service.go +++ b/internal/commands/fakes/pivnet_product_files_service.go @@ -4,7 +4,7 @@ package fakes import ( "sync" - pivnet "github.com/pivotal-cf/go-pivnet/v2" + pivnet "github.com/pivotal-cf/go-pivnet/v7" "github.com/pivotal-cf/kiln/internal/commands" ) diff --git a/internal/commands/fakes/pivnet_release_dependencies_service.go b/internal/commands/fakes/pivnet_release_dependencies_service.go index 43840debe..717327df1 100644 --- a/internal/commands/fakes/pivnet_release_dependencies_service.go +++ b/internal/commands/fakes/pivnet_release_dependencies_service.go @@ -4,7 +4,7 @@ package fakes import ( "sync" - pivnet "github.com/pivotal-cf/go-pivnet/v2" + pivnet "github.com/pivotal-cf/go-pivnet/v7" "github.com/pivotal-cf/kiln/internal/commands" ) diff --git a/internal/commands/fakes/pivnet_release_upgrade_paths_service.go b/internal/commands/fakes/pivnet_release_upgrade_paths_service.go index 0670c2d1f..20014edf1 100644 --- a/internal/commands/fakes/pivnet_release_upgrade_paths_service.go +++ b/internal/commands/fakes/pivnet_release_upgrade_paths_service.go @@ -4,7 +4,7 @@ package fakes import ( "sync" - pivnet "github.com/pivotal-cf/go-pivnet/v2" + pivnet "github.com/pivotal-cf/go-pivnet/v7" "github.com/pivotal-cf/kiln/internal/commands" ) diff --git a/internal/commands/fakes/pivnet_releases_service.go b/internal/commands/fakes/pivnet_releases_service.go index 563562a5a..dcbc331d1 100644 --- a/internal/commands/fakes/pivnet_releases_service.go +++ b/internal/commands/fakes/pivnet_releases_service.go @@ -4,15 +4,16 @@ package fakes import ( "sync" - pivnet "github.com/pivotal-cf/go-pivnet/v2" + pivnet "github.com/pivotal-cf/go-pivnet/v7" "github.com/pivotal-cf/kiln/internal/commands" ) type PivnetReleasesService struct { - ListStub func(string) ([]pivnet.Release, error) + ListStub func(string, ...pivnet.QueryParameter) ([]pivnet.Release, error) listMutex sync.RWMutex listArgsForCall []struct { arg1 string + arg2 []pivnet.QueryParameter } listReturns struct { result1 []pivnet.Release @@ -40,18 +41,19 @@ type PivnetReleasesService struct { invocationsMutex sync.RWMutex } -func (fake *PivnetReleasesService) List(arg1 string) ([]pivnet.Release, error) { +func (fake *PivnetReleasesService) List(arg1 string, arg2 ...pivnet.QueryParameter) ([]pivnet.Release, error) { fake.listMutex.Lock() ret, specificReturn := fake.listReturnsOnCall[len(fake.listArgsForCall)] fake.listArgsForCall = append(fake.listArgsForCall, struct { arg1 string - }{arg1}) + arg2 []pivnet.QueryParameter + }{arg1, arg2}) stub := fake.ListStub fakeReturns := fake.listReturns - fake.recordInvocation("List", []interface{}{arg1}) + fake.recordInvocation("List", []interface{}{arg1, arg2}) fake.listMutex.Unlock() if stub != nil { - return stub(arg1) + return stub(arg1, arg2...) } if specificReturn { return ret.result1, ret.result2 @@ -65,17 +67,17 @@ func (fake *PivnetReleasesService) ListCallCount() int { return len(fake.listArgsForCall) } -func (fake *PivnetReleasesService) ListCalls(stub func(string) ([]pivnet.Release, error)) { +func (fake *PivnetReleasesService) ListCalls(stub func(string, ...pivnet.QueryParameter) ([]pivnet.Release, error)) { fake.listMutex.Lock() defer fake.listMutex.Unlock() fake.ListStub = stub } -func (fake *PivnetReleasesService) ListArgsForCall(i int) string { +func (fake *PivnetReleasesService) ListArgsForCall(i int) (string, []pivnet.QueryParameter) { fake.listMutex.RLock() defer fake.listMutex.RUnlock() argsForCall := fake.listArgsForCall[i] - return argsForCall.arg1 + return argsForCall.arg1, argsForCall.arg2 } func (fake *PivnetReleasesService) ListReturns(result1 []pivnet.Release, result2 error) { diff --git a/internal/commands/fakes/pivnet_user_groups_service.go b/internal/commands/fakes/pivnet_user_groups_service.go index f2995946e..0d0979c9d 100644 --- a/internal/commands/fakes/pivnet_user_groups_service.go +++ b/internal/commands/fakes/pivnet_user_groups_service.go @@ -4,7 +4,7 @@ package fakes import ( "sync" - pivnet "github.com/pivotal-cf/go-pivnet/v2" + pivnet "github.com/pivotal-cf/go-pivnet/v7" "github.com/pivotal-cf/kiln/internal/commands" ) diff --git a/internal/commands/publish.go b/internal/commands/publish.go index 855e2a013..dc752150b 100644 --- a/internal/commands/publish.go +++ b/internal/commands/publish.go @@ -13,8 +13,8 @@ import ( "github.com/Masterminds/semver/v3" "github.com/go-git/go-billy/v5" - "github.com/pivotal-cf/go-pivnet/v2" - "github.com/pivotal-cf/go-pivnet/v2/logshim" + "github.com/pivotal-cf/go-pivnet/v7" + "github.com/pivotal-cf/go-pivnet/v7/logshim" "github.com/pivotal-cf/jhanda" "gopkg.in/yaml.v2" @@ -28,7 +28,7 @@ const ( //counterfeiter:generate -o ./fakes/pivnet_releases_service.go --fake-name PivnetReleasesService . PivnetReleasesService type PivnetReleasesService interface { - List(productSlug string) ([]pivnet.Release, error) + List(productSlug string, _ ...pivnet.QueryParameter) ([]pivnet.Release, error) Update(productSlug string, release pivnet.Release) (pivnet.Release, error) } diff --git a/internal/commands/publish_test.go b/internal/commands/publish_test.go index ad4e8ed53..761b24e57 100644 --- a/internal/commands/publish_test.go +++ b/internal/commands/publish_test.go @@ -14,7 +14,7 @@ import ( "github.com/go-git/go-billy/v5" "github.com/go-git/go-billy/v5/memfs" - "github.com/pivotal-cf/go-pivnet/v2" + "github.com/pivotal-cf/go-pivnet/v7" "github.com/pivotal-cf/kiln/internal/commands" commandsFakes "github.com/pivotal-cf/kiln/internal/commands/fakes" From 8dd34e3a49e173a815e894cb3bb4ec83ebce8022 Mon Sep 17 00:00:00 2001 From: Christopher Hunter Date: Thu, 31 Aug 2023 10:53:26 -0700 Subject: [PATCH 2/2] fix: move notes fakes to internal package there was a problem with the generate statements --- pkg/notes/internal/fakes/historic_kilnfile.go | 14 +++++++------- pkg/notes/internal/fakes/historic_version.go | 14 +++++++------- pkg/notes/internal/fakes/issue_getter.go | 14 +++++++------- .../internal/fakes/issues_by_repo_lister.go | 14 +++++++------- pkg/notes/internal/fakes/issues_service.go | 18 +++++++++--------- pkg/notes/internal/fakes/milestone_lister.go | 14 +++++++------- pkg/notes/internal/fakes/releases_service.go | 14 +++++++------- pkg/notes/internal/fakes/revision_resolver.go | 14 +++++++------- pkg/notes/notes_data.go | 16 ++++++++-------- 9 files changed, 66 insertions(+), 66 deletions(-) diff --git a/pkg/notes/internal/fakes/historic_kilnfile.go b/pkg/notes/internal/fakes/historic_kilnfile.go index d687dc660..8a05a0452 100644 --- a/pkg/notes/internal/fakes/historic_kilnfile.go +++ b/pkg/notes/internal/fakes/historic_kilnfile.go @@ -27,7 +27,7 @@ type HistoricKilnfile struct { result2 cargo.KilnfileLock result3 error } - invocations map[string][][]any + invocations map[string][][]interface{} invocationsMutex sync.RWMutex } @@ -41,7 +41,7 @@ func (fake *HistoricKilnfile) Spy(arg1 storer.EncodedObjectStorer, arg2 plumbing }{arg1, arg2, arg3}) stub := fake.Stub returns := fake.returns - fake.recordInvocation("historicKilnfile", []any{arg1, arg2, arg3}) + fake.recordInvocation("historicKilnfile", []interface{}{arg1, arg2, arg3}) fake.mutex.Unlock() if stub != nil { return stub(arg1, arg2, arg3) @@ -99,26 +99,26 @@ func (fake *HistoricKilnfile) ReturnsOnCall(i int, result1 cargo.Kilnfile, resul }{result1, result2, result3} } -func (fake *HistoricKilnfile) Invocations() map[string][][]any { +func (fake *HistoricKilnfile) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() fake.mutex.RLock() defer fake.mutex.RUnlock() - copiedInvocations := map[string][][]any{} + copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value } return copiedInvocations } -func (fake *HistoricKilnfile) recordInvocation(key string, args []any) { +func (fake *HistoricKilnfile) recordInvocation(key string, args []interface{}) { fake.invocationsMutex.Lock() defer fake.invocationsMutex.Unlock() if fake.invocations == nil { - fake.invocations = map[string][][]any{} + fake.invocations = map[string][][]interface{}{} } if fake.invocations[key] == nil { - fake.invocations[key] = [][]any{} + fake.invocations[key] = [][]interface{}{} } fake.invocations[key] = append(fake.invocations[key], args) } diff --git a/pkg/notes/internal/fakes/historic_version.go b/pkg/notes/internal/fakes/historic_version.go index deb321033..b3d47fb2e 100644 --- a/pkg/notes/internal/fakes/historic_version.go +++ b/pkg/notes/internal/fakes/historic_version.go @@ -24,7 +24,7 @@ type HistoricVersion struct { result1 string result2 error } - invocations map[string][][]any + invocations map[string][][]interface{} invocationsMutex sync.RWMutex } @@ -38,7 +38,7 @@ func (fake *HistoricVersion) Spy(arg1 storer.EncodedObjectStorer, arg2 plumbing. }{arg1, arg2, arg3}) stub := fake.Stub returns := fake.returns - fake.recordInvocation("historicVersion", []any{arg1, arg2, arg3}) + fake.recordInvocation("historicVersion", []interface{}{arg1, arg2, arg3}) fake.mutex.Unlock() if stub != nil { return stub(arg1, arg2, arg3) @@ -93,26 +93,26 @@ func (fake *HistoricVersion) ReturnsOnCall(i int, result1 string, result2 error) }{result1, result2} } -func (fake *HistoricVersion) Invocations() map[string][][]any { +func (fake *HistoricVersion) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() fake.mutex.RLock() defer fake.mutex.RUnlock() - copiedInvocations := map[string][][]any{} + copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value } return copiedInvocations } -func (fake *HistoricVersion) recordInvocation(key string, args []any) { +func (fake *HistoricVersion) recordInvocation(key string, args []interface{}) { fake.invocationsMutex.Lock() defer fake.invocationsMutex.Unlock() if fake.invocations == nil { - fake.invocations = map[string][][]any{} + fake.invocations = map[string][][]interface{}{} } if fake.invocations[key] == nil { - fake.invocations[key] = [][]any{} + fake.invocations[key] = [][]interface{}{} } fake.invocations[key] = append(fake.invocations[key], args) } diff --git a/pkg/notes/internal/fakes/issue_getter.go b/pkg/notes/internal/fakes/issue_getter.go index fcd0c6451..3dbaa90cc 100644 --- a/pkg/notes/internal/fakes/issue_getter.go +++ b/pkg/notes/internal/fakes/issue_getter.go @@ -27,7 +27,7 @@ type IssueGetter struct { result2 *github.Response result3 error } - invocations map[string][][]any + invocations map[string][][]interface{} invocationsMutex sync.RWMutex } @@ -42,7 +42,7 @@ func (fake *IssueGetter) Get(arg1 context.Context, arg2 string, arg3 string, arg }{arg1, arg2, arg3, arg4}) stub := fake.GetStub fakeReturns := fake.getReturns - fake.recordInvocation("Get", []any{arg1, arg2, arg3, arg4}) + fake.recordInvocation("Get", []interface{}{arg1, arg2, arg3, arg4}) fake.getMutex.Unlock() if stub != nil { return stub(arg1, arg2, arg3, arg4) @@ -101,26 +101,26 @@ func (fake *IssueGetter) GetReturnsOnCall(i int, result1 *github.Issue, result2 }{result1, result2, result3} } -func (fake *IssueGetter) Invocations() map[string][][]any { +func (fake *IssueGetter) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() fake.getMutex.RLock() defer fake.getMutex.RUnlock() - copiedInvocations := map[string][][]any{} + copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value } return copiedInvocations } -func (fake *IssueGetter) recordInvocation(key string, args []any) { +func (fake *IssueGetter) recordInvocation(key string, args []interface{}) { fake.invocationsMutex.Lock() defer fake.invocationsMutex.Unlock() if fake.invocations == nil { - fake.invocations = map[string][][]any{} + fake.invocations = map[string][][]interface{}{} } if fake.invocations[key] == nil { - fake.invocations[key] = [][]any{} + fake.invocations[key] = [][]interface{}{} } fake.invocations[key] = append(fake.invocations[key], args) } diff --git a/pkg/notes/internal/fakes/issues_by_repo_lister.go b/pkg/notes/internal/fakes/issues_by_repo_lister.go index af96733bd..f63c2368d 100644 --- a/pkg/notes/internal/fakes/issues_by_repo_lister.go +++ b/pkg/notes/internal/fakes/issues_by_repo_lister.go @@ -27,7 +27,7 @@ type IssuesByRepoLister struct { result2 *github.Response result3 error } - invocations map[string][][]any + invocations map[string][][]interface{} invocationsMutex sync.RWMutex } @@ -42,7 +42,7 @@ func (fake *IssuesByRepoLister) ListByRepo(arg1 context.Context, arg2 string, ar }{arg1, arg2, arg3, arg4}) stub := fake.ListByRepoStub fakeReturns := fake.listByRepoReturns - fake.recordInvocation("ListByRepo", []any{arg1, arg2, arg3, arg4}) + fake.recordInvocation("ListByRepo", []interface{}{arg1, arg2, arg3, arg4}) fake.listByRepoMutex.Unlock() if stub != nil { return stub(arg1, arg2, arg3, arg4) @@ -101,26 +101,26 @@ func (fake *IssuesByRepoLister) ListByRepoReturnsOnCall(i int, result1 []*github }{result1, result2, result3} } -func (fake *IssuesByRepoLister) Invocations() map[string][][]any { +func (fake *IssuesByRepoLister) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() fake.listByRepoMutex.RLock() defer fake.listByRepoMutex.RUnlock() - copiedInvocations := map[string][][]any{} + copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value } return copiedInvocations } -func (fake *IssuesByRepoLister) recordInvocation(key string, args []any) { +func (fake *IssuesByRepoLister) recordInvocation(key string, args []interface{}) { fake.invocationsMutex.Lock() defer fake.invocationsMutex.Unlock() if fake.invocations == nil { - fake.invocations = map[string][][]any{} + fake.invocations = map[string][][]interface{}{} } if fake.invocations[key] == nil { - fake.invocations[key] = [][]any{} + fake.invocations[key] = [][]interface{}{} } fake.invocations[key] = append(fake.invocations[key], args) } diff --git a/pkg/notes/internal/fakes/issues_service.go b/pkg/notes/internal/fakes/issues_service.go index 0b902787b..fb4af88f0 100644 --- a/pkg/notes/internal/fakes/issues_service.go +++ b/pkg/notes/internal/fakes/issues_service.go @@ -63,7 +63,7 @@ type IssuesService struct { result2 *github.Response result3 error } - invocations map[string][][]any + invocations map[string][][]interface{} invocationsMutex sync.RWMutex } @@ -78,7 +78,7 @@ func (fake *IssuesService) Get(arg1 context.Context, arg2 string, arg3 string, a }{arg1, arg2, arg3, arg4}) stub := fake.GetStub fakeReturns := fake.getReturns - fake.recordInvocation("Get", []any{arg1, arg2, arg3, arg4}) + fake.recordInvocation("Get", []interface{}{arg1, arg2, arg3, arg4}) fake.getMutex.Unlock() if stub != nil { return stub(arg1, arg2, arg3, arg4) @@ -148,7 +148,7 @@ func (fake *IssuesService) ListByRepo(arg1 context.Context, arg2 string, arg3 st }{arg1, arg2, arg3, arg4}) stub := fake.ListByRepoStub fakeReturns := fake.listByRepoReturns - fake.recordInvocation("ListByRepo", []any{arg1, arg2, arg3, arg4}) + fake.recordInvocation("ListByRepo", []interface{}{arg1, arg2, arg3, arg4}) fake.listByRepoMutex.Unlock() if stub != nil { return stub(arg1, arg2, arg3, arg4) @@ -218,7 +218,7 @@ func (fake *IssuesService) ListMilestones(arg1 context.Context, arg2 string, arg }{arg1, arg2, arg3, arg4}) stub := fake.ListMilestonesStub fakeReturns := fake.listMilestonesReturns - fake.recordInvocation("ListMilestones", []any{arg1, arg2, arg3, arg4}) + fake.recordInvocation("ListMilestones", []interface{}{arg1, arg2, arg3, arg4}) fake.listMilestonesMutex.Unlock() if stub != nil { return stub(arg1, arg2, arg3, arg4) @@ -277,7 +277,7 @@ func (fake *IssuesService) ListMilestonesReturnsOnCall(i int, result1 []*github. }{result1, result2, result3} } -func (fake *IssuesService) Invocations() map[string][][]any { +func (fake *IssuesService) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() fake.getMutex.RLock() @@ -286,21 +286,21 @@ func (fake *IssuesService) Invocations() map[string][][]any { defer fake.listByRepoMutex.RUnlock() fake.listMilestonesMutex.RLock() defer fake.listMilestonesMutex.RUnlock() - copiedInvocations := map[string][][]any{} + copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value } return copiedInvocations } -func (fake *IssuesService) recordInvocation(key string, args []any) { +func (fake *IssuesService) recordInvocation(key string, args []interface{}) { fake.invocationsMutex.Lock() defer fake.invocationsMutex.Unlock() if fake.invocations == nil { - fake.invocations = map[string][][]any{} + fake.invocations = map[string][][]interface{}{} } if fake.invocations[key] == nil { - fake.invocations[key] = [][]any{} + fake.invocations[key] = [][]interface{}{} } fake.invocations[key] = append(fake.invocations[key], args) } diff --git a/pkg/notes/internal/fakes/milestone_lister.go b/pkg/notes/internal/fakes/milestone_lister.go index ec4389a97..02d2c029d 100644 --- a/pkg/notes/internal/fakes/milestone_lister.go +++ b/pkg/notes/internal/fakes/milestone_lister.go @@ -27,7 +27,7 @@ type MilestoneLister struct { result2 *github.Response result3 error } - invocations map[string][][]any + invocations map[string][][]interface{} invocationsMutex sync.RWMutex } @@ -42,7 +42,7 @@ func (fake *MilestoneLister) ListMilestones(arg1 context.Context, arg2 string, a }{arg1, arg2, arg3, arg4}) stub := fake.ListMilestonesStub fakeReturns := fake.listMilestonesReturns - fake.recordInvocation("ListMilestones", []any{arg1, arg2, arg3, arg4}) + fake.recordInvocation("ListMilestones", []interface{}{arg1, arg2, arg3, arg4}) fake.listMilestonesMutex.Unlock() if stub != nil { return stub(arg1, arg2, arg3, arg4) @@ -101,26 +101,26 @@ func (fake *MilestoneLister) ListMilestonesReturnsOnCall(i int, result1 []*githu }{result1, result2, result3} } -func (fake *MilestoneLister) Invocations() map[string][][]any { +func (fake *MilestoneLister) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() fake.listMilestonesMutex.RLock() defer fake.listMilestonesMutex.RUnlock() - copiedInvocations := map[string][][]any{} + copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value } return copiedInvocations } -func (fake *MilestoneLister) recordInvocation(key string, args []any) { +func (fake *MilestoneLister) recordInvocation(key string, args []interface{}) { fake.invocationsMutex.Lock() defer fake.invocationsMutex.Unlock() if fake.invocations == nil { - fake.invocations = map[string][][]any{} + fake.invocations = map[string][][]interface{}{} } if fake.invocations[key] == nil { - fake.invocations[key] = [][]any{} + fake.invocations[key] = [][]interface{}{} } fake.invocations[key] = append(fake.invocations[key], args) } diff --git a/pkg/notes/internal/fakes/releases_service.go b/pkg/notes/internal/fakes/releases_service.go index f97492ca4..0d89fd752 100644 --- a/pkg/notes/internal/fakes/releases_service.go +++ b/pkg/notes/internal/fakes/releases_service.go @@ -28,7 +28,7 @@ type ReleaseService struct { result2 *github.Response result3 error } - invocations map[string][][]any + invocations map[string][][]interface{} invocationsMutex sync.RWMutex } @@ -43,7 +43,7 @@ func (fake *ReleaseService) ListReleases(arg1 context.Context, arg2 string, arg3 }{arg1, arg2, arg3, arg4}) stub := fake.ListReleasesStub fakeReturns := fake.listReleasesReturns - fake.recordInvocation("ListReleases", []any{arg1, arg2, arg3, arg4}) + fake.recordInvocation("ListReleases", []interface{}{arg1, arg2, arg3, arg4}) fake.listReleasesMutex.Unlock() if stub != nil { return stub(arg1, arg2, arg3, arg4) @@ -102,26 +102,26 @@ func (fake *ReleaseService) ListReleasesReturnsOnCall(i int, result1 []*github.R }{result1, result2, result3} } -func (fake *ReleaseService) Invocations() map[string][][]any { +func (fake *ReleaseService) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() fake.listReleasesMutex.RLock() defer fake.listReleasesMutex.RUnlock() - copiedInvocations := map[string][][]any{} + copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value } return copiedInvocations } -func (fake *ReleaseService) recordInvocation(key string, args []any) { +func (fake *ReleaseService) recordInvocation(key string, args []interface{}) { fake.invocationsMutex.Lock() defer fake.invocationsMutex.Unlock() if fake.invocations == nil { - fake.invocations = map[string][][]any{} + fake.invocations = map[string][][]interface{}{} } if fake.invocations[key] == nil { - fake.invocations[key] = [][]any{} + fake.invocations[key] = [][]interface{}{} } fake.invocations[key] = append(fake.invocations[key], args) } diff --git a/pkg/notes/internal/fakes/revision_resolver.go b/pkg/notes/internal/fakes/revision_resolver.go index 5d0e54f9b..68269f21a 100644 --- a/pkg/notes/internal/fakes/revision_resolver.go +++ b/pkg/notes/internal/fakes/revision_resolver.go @@ -21,7 +21,7 @@ type RevisionResolver struct { result1 *plumbing.Hash result2 error } - invocations map[string][][]any + invocations map[string][][]interface{} invocationsMutex sync.RWMutex } @@ -33,7 +33,7 @@ func (fake *RevisionResolver) ResolveRevision(arg1 plumbing.Revision) (*plumbing }{arg1}) stub := fake.ResolveRevisionStub fakeReturns := fake.resolveRevisionReturns - fake.recordInvocation("ResolveRevision", []any{arg1}) + fake.recordInvocation("ResolveRevision", []interface{}{arg1}) fake.resolveRevisionMutex.Unlock() if stub != nil { return stub(arg1) @@ -89,26 +89,26 @@ func (fake *RevisionResolver) ResolveRevisionReturnsOnCall(i int, result1 *plumb }{result1, result2} } -func (fake *RevisionResolver) Invocations() map[string][][]any { +func (fake *RevisionResolver) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() fake.resolveRevisionMutex.RLock() defer fake.resolveRevisionMutex.RUnlock() - copiedInvocations := map[string][][]any{} + copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value } return copiedInvocations } -func (fake *RevisionResolver) recordInvocation(key string, args []any) { +func (fake *RevisionResolver) recordInvocation(key string, args []interface{}) { fake.invocationsMutex.Lock() defer fake.invocationsMutex.Unlock() if fake.invocations == nil { - fake.invocations = map[string][][]any{} + fake.invocations = map[string][][]interface{}{} } if fake.invocations[key] == nil { - fake.invocations[key] = [][]any{} + fake.invocations[key] = [][]interface{}{} } fake.invocations[key] = append(fake.invocations[key], args) } diff --git a/pkg/notes/notes_data.go b/pkg/notes/notes_data.go index cdadf6215..6d84b745d 100644 --- a/pkg/notes/notes_data.go +++ b/pkg/notes/notes_data.go @@ -269,15 +269,15 @@ func (r fetchNotesData) kilnfileFromWorktree(kilnfilePath string) (cargo.Kilnfil return wtKf, nil } -//counterfeiter:generate -o ./fakes/historic_version.go --fake-name HistoricVersion . historicVersion +//counterfeiter:generate -o ./internal/fakes/historic_version.go --fake-name HistoricVersion . historicVersion type historicVersion func(repo storer.EncodedObjectStorer, commitHash plumbing.Hash, kilnfilePath string) (string, error) -//counterfeiter:generate -o ./fakes/historic_kilnfile.go --fake-name HistoricKilnfile . historicKilnfile +//counterfeiter:generate -o ./internal/fakes/historic_kilnfile.go --fake-name HistoricKilnfile . historicKilnfile type historicKilnfile func(repo storer.EncodedObjectStorer, commitHash plumbing.Hash, kilnfilePath string) (cargo.Kilnfile, cargo.KilnfileLock, error) -//counterfeiter:generate -o ./fakes/revision_resolver.go --fake-name RevisionResolver . revisionResolver +//counterfeiter:generate -o ./internal/fakes/revision_resolver.go --fake-name RevisionResolver . revisionResolver type revisionResolver interface { ResolveRevision(rev plumbing.Revision) (*plumbing.Hash, error) @@ -314,8 +314,8 @@ func (r fetchNotesData) fetchHistoricFiles(kilnfilePath, start, end string) (klI return klInitial, klFinal, kfFinal, v, nil } -//counterfeiter:generate -o ./fakes/releases_service.go --fake-name ReleaseService github.com/pivotal-cf/kiln/pkg/cargo.RepositoryReleaseLister -//counterfeiter:generate -o ./fakes/issues_service.go --fake-name IssuesService . issuesService +//counterfeiter:generate -o ./internal/fakes/releases_service.go --fake-name ReleaseService github.com/pivotal-cf/kiln/pkg/cargo.RepositoryReleaseLister +//counterfeiter:generate -o ./internal/fakes/issues_service.go --fake-name IssuesService . issuesService type issuesService interface { issueGetter @@ -355,7 +355,7 @@ func (r fetchNotesData) fetchIssuesAndReleaseNotes(ctx context.Context, finalKF, return appendFilterAndSortIssues(issues, additionalIssues, issuesQuery.IssueTitleExp), bumpList, nil } -//counterfeiter:generate -o ./fakes/issue_getter.go --fake-name IssueGetter . issueGetter +//counterfeiter:generate -o ./internal/fakes/issue_getter.go --fake-name IssueGetter . issueGetter type issueGetter interface { Get(ctx context.Context, owner string, repo string, number int) (*github.Issue, *github.Response, error) @@ -380,7 +380,7 @@ func issuesFromIssueIDs(ctx context.Context, issuesService issueGetter, repoOwne return issues, nil } -//counterfeiter:generate -o ./fakes/milestone_lister.go --fake-name MilestoneLister . milestoneLister +//counterfeiter:generate -o ./internal/fakes/milestone_lister.go --fake-name MilestoneLister . milestoneLister type milestoneLister interface { ListMilestones(ctx context.Context, owner string, repo string, opts *github.MilestoneListOptions) ([]*github.Milestone, *github.Response, error) @@ -418,7 +418,7 @@ func resolveMilestoneNumber(ctx context.Context, issuesService milestoneLister, } } -//counterfeiter:generate -o ./fakes/issues_by_repo_lister.go --fake-name IssuesByRepoLister . issuesByRepoLister +//counterfeiter:generate -o ./internal/fakes/issues_by_repo_lister.go --fake-name IssuesByRepoLister . issuesByRepoLister type issuesByRepoLister interface { ListByRepo(ctx context.Context, owner string, repo string, opts *github.IssueListByRepoOptions) ([]*github.Issue, *github.Response, error)