A library extends OAuth2 for Go.
- Asynchronous preloading of a token
go get github.com/rxnew/go-oauth2x
package main
import (
"context"
"github.com/rxnew/go-oauth2x"
"golang.org/x/oauth2"
)
func main() {
c := &oauth2.Config{ /* Configure */ }
ctx := context.Background()
cli := oauth2x.NewClient(ctx, c.TokenSource(ctx, nil))
resp, err := cli.Get("https://example.com")
// Process the response
}