Use empty TODO context instead of nil

This commit is contained in:
Alexandre Oliveira 2023-03-31 16:16:01 +02:00
parent e079f301dd
commit 7e0b8b3d6a

View File

@ -20,9 +20,9 @@ type Client struct {
func (p *Provider) getClient() error {
if p.client.vultr == nil {
oauth_cfg := &oauth2.Config{}
oauth_token_source := oauth_cfg.TokenSource(nil, &oauth2.Token{AccessToken: p.APIToken})
oauth_token_source := oauth_cfg.TokenSource(context.TODO(), &oauth2.Token{AccessToken: p.APIToken})
p.client.vultr = govultr.NewClient(oauth2.NewClient(nil, oauth_token_source))
p.client.vultr = govultr.NewClient(oauth2.NewClient(context.TODO(), oauth_token_source))
}
return nil