var credentialCache … var authOnce … // AddCredentials populates the request header with the user's credentials // as specified by the GOAUTH environment variable. // It returns whether any matching credentials were found. // req must use HTTPS or this function will panic. func AddCredentials(req *http.Request) bool { … } // runGoAuth executes authentication commands specified by the GOAUTH // environment variable handling 'off', 'netrc', and 'git' methods specially, // and storing retrieved credentials for future access. func runGoAuth() { … } // loadCredential retrieves cached credentials for the given url prefix and adds // them to the request headers. func loadCredential(req *http.Request, prefix string) bool { … } // storeCredential caches or removes credentials (represented by HTTP headers) // associated with given URL prefixes. func storeCredential(prefixes []string, header http.Header) { … }