Skip to content

Commit fbf835f

Browse files
authored
[chore] Use static token in GitHub source (#3834)
Also some minor formatting in sources.go
1 parent a94d152 commit fbf835f

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

pkg/sources/github/connector_token.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func newTokenConnector(apiEndpoint string, token string, handleRateLimit func(co
3030
tokenSource := oauth2.StaticTokenSource(&oauth2.Token{AccessToken: token})
3131
httpClient.Transport = &oauth2.Transport{
3232
Base: httpClient.Transport,
33-
Source: oauth2.ReuseTokenSource(nil, tokenSource),
33+
Source: tokenSource,
3434
}
3535

3636
apiClient, err := createGitHubClient(httpClient, apiEndpoint)

pkg/sources/sources.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,15 @@ type SourceUnitEnumerator interface {
9898
// synchronous but can be called in a goroutine to support concurrent
9999
// enumeration and chunking. An error should only be returned from this
100100
// method in the case of context cancellation, fatal source errors, or
101-
// errors returned by the reporter All other errors related to unit
101+
// errors returned by the reporter. All other errors related to unit
102102
// enumeration are tracked by the UnitReporter.
103103
Enumerate(ctx context.Context, reporter UnitReporter) error
104104
}
105105

106106
// BaseUnitReporter is a helper struct that implements the UnitReporter interface
107107
// and includes a JobProgress reference.
108108
type baseUnitReporter struct {
109-
child UnitReporter
109+
child UnitReporter
110110
progress *JobProgress
111111
}
112112

@@ -126,7 +126,6 @@ func (b baseUnitReporter) UnitErr(ctx context.Context, err error) error {
126126
return nil
127127
}
128128

129-
130129
// UnitReporter defines the interface a source will use to report whether a
131130
// unit was found during enumeration. Either method may be called any number of
132131
// times. Implementors of this interface should allow for concurrent calls.

0 commit comments

Comments
 (0)