Skip to content

Commit ac8e270

Browse files
authored
Merge pull request #143 from jbowens/nocontext
Remove references to deprecated oauth2.NoContext
2 parents 83908b1 + 83030a1 commit ac8e270

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func (t *TokenSource) Token() (*oauth2.Token, error) {
4444
tokenSource := &TokenSource{
4545
AccessToken: pat,
4646
}
47-
oauthClient := oauth2.NewClient(oauth2.NoContext, tokenSource)
47+
oauthClient := oauth2.NewClient(context.Background(), tokenSource)
4848
client := godo.NewClient(oauthClient)
4949
```
5050

util/droplet_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@ func ExampleWaitForActive() {
1313
token := &oauth2.Token{AccessToken: pat}
1414
t := oauth2.StaticTokenSource(token)
1515

16-
oauthClient := oauth2.NewClient(oauth2.NoContext, t)
16+
ctx := context.TODO()
17+
oauthClient := oauth2.NewClient(ctx, t)
1718
client := godo.NewClient(oauthClient)
1819

1920
// create your droplet and retrieve the create action uri
2021
uri := "https://api.digitalocean.com/v2/actions/xxxxxxxx"
2122

2223
// block until until the action is complete
23-
err := WaitForActive(context.TODO(), client, uri)
24+
err := WaitForActive(ctx, client, uri)
2425
if err != nil {
2526
panic(err)
2627
}

0 commit comments

Comments
 (0)