Fix OAuth2
nil contexts are no more allowed in the oauth2 package.
This patch fixes https://github.com/McKael/madonctl/issues/12.
--- a/login.go Sat Oct 28 22:43:54 2017 +0200
+++ b/login.go Wed Nov 01 10:20:45 2017 +0100
@@ -10,6 +10,7 @@
"encoding/json"
"strings"
+ "golang.org/x/net/context"
"golang.org/x/oauth2"
"github.com/pkg/errors"
@@ -117,7 +118,7 @@
}
// Return token
- t, err := conf.Exchange(nil, code)
+ t, err := conf.Exchange(context.TODO(), code)
if err != nil {
return "", errors.Wrap(err, "cannot convert code into a token")
}