Skip to content

Commit 3738adf

Browse files
committed
Remove context parameter
1 parent 108aa8e commit 3738adf

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

‎github/github.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,8 @@ func NewClient(httpClient *http.Client) *Client {
348348
}
349349

350350
// NewTokenClient returns a new GitHub API client authenticated with the provided token.
351-
func NewTokenClient(ctx context.Context, token string) *Client {
352-
return NewClient(oauth2.NewClient(ctx, oauth2.StaticTokenSource(&oauth2.Token{AccessToken: token})))
351+
func NewTokenClient(token string) *Client {
352+
return NewClient(oauth2.NewClient(nil, oauth2.StaticTokenSource(&oauth2.Token{AccessToken: token})))
353353
}
354354

355355
// NewEnterpriseClient returns a new GitHub API client with provided

‎github/github_test.go‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,7 @@ func TestClient(t *testing.T) {
269269

270270
func TestNewTokenClient(t *testing.T) {
271271
token := "gh_test_token"
272-
ctx := context.Background()
273-
c := NewTokenClient(ctx, token)
272+
c := NewTokenClient(token)
274273
tr, ok := c.Client().Transport.(*oauth2.Transport)
275274
if !ok {
276275
t.Error("Client transport is not oauth2.Transport")

0 commit comments

Comments
 (0)