diff --git a/pkg/sources/github/github.go b/pkg/sources/github/github.go index 7866e9e8..b2fc1f27 100644 --- a/pkg/sources/github/github.go +++ b/pkg/sources/github/github.go @@ -51,7 +51,7 @@ type Source struct { conn *sourcespb.GitHub jobSem *semaphore.Weighted resumeInfoSlice []string - resumeInfoMutex *sync.Mutex + resumeInfoMutex sync.Mutex sources.Progress } diff --git a/pkg/sources/github/github_test.go b/pkg/sources/github/github_test.go index a73f60fc..0db9a527 100644 --- a/pkg/sources/github/github_test.go +++ b/pkg/sources/github/github_test.go @@ -12,7 +12,6 @@ import ( "reflect" "sort" "strconv" - "sync" "testing" "time" @@ -362,9 +361,8 @@ func Test_setProgressCompleteWithRepo(t *testing.T) { logger := logrus.New() logger.Out = io.Discard s := &Source{ - repos: []string{}, - log: logger.WithField("no", "output"), - resumeInfoMutex: &sync.Mutex{}, + repos: []string{}, + log: logger.WithField("no", "output"), } for _, tt := range tests { @@ -402,9 +400,8 @@ func Test_removeRepoFromResumeInfo(t *testing.T) { logger := logrus.New() logger.Out = io.Discard s := &Source{ - repos: []string{}, - log: logger.WithField("no", "output"), - resumeInfoMutex: &sync.Mutex{}, + repos: []string{}, + log: logger.WithField("no", "output"), } for _, tt := range tests { @@ -434,9 +431,8 @@ func Test_encodeResumeInfo(t *testing.T) { logger := logrus.New() logger.Out = io.Discard s := &Source{ - repos: []string{}, - log: logger.WithField("no", "output"), - resumeInfoMutex: &sync.Mutex{}, + repos: []string{}, + log: logger.WithField("no", "output"), } for _, tt := range tests { @@ -514,8 +510,7 @@ func Test_filterReposToResume(t *testing.T) { for name, tt := range tests { s := &Source{ - repos: startingRepos, - resumeInfoMutex: &sync.Mutex{}, + repos: startingRepos, } gotProgressOffsetCount := s.filterReposToResume(tt.resumeInfo)