Use empty TODO context instead of nil

This commit is contained in:
Alexandre Oliveira 2023-03-31 16:16:01 +02:00
parent 76c18636cd
commit af3868345c

View File

@ -20,9 +20,9 @@ type Client struct {
func (p *Provider) getClient() error { func (p *Provider) getClient() error {
if p.client.vultr == nil { if p.client.vultr == nil {
oauth_cfg := &oauth2.Config{} 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 return nil