How to Implement OAuth2 Flow in Go
Use the GOAUTH environment variable to configure authentication commands for the go command.
export GOAUTH="git /path/to/git/repo"
go get example.com/private/module
The go command executes the specified command (e.g., git credential fill) to retrieve credentials and attaches them to HTTP requests for module downloads.