Refactor to use static tokens

Signed-off-by: Tim <timfall@gmail.com>
This commit is contained in:
Tim 2015-07-31 19:34:38 -04:00
parent 402c82c164
commit a9b9f88df7
1 changed files with 4 additions and 4 deletions

View File

@ -9,11 +9,11 @@ import (
func ExampleWaitForActive() {
// build client
pat := "mytoken"
t := &oauth2.Transport{
Token: &oauth2.Token{AccessToken: pat},
}
token := &oauth2.Token{AccessToken: pat}
t := oauth2.StaticTokenSource(token)
client := godo.NewClient(t.Client())
oauthClient := oauth2.NewClient(oauth2.NoContext, t)
client := godo.NewClient(oauthClient)
// create your droplet and retrieve the create action uri
uri := "https://api.digitalocean.com/v2/actions/xxxxxxxx"