package auth

import "cmd/go/internal/auth"

Package auth provides access to user-provided authentication credentials.

Index

Functions

func AddCredentials

func AddCredentials(client *http.Client, req *http.Request, res *http.Response, url string) bool

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. res is used for the custom GOAUTH command's stdin.

Source Files

auth.go gitauth.go httputils.go netrc.go userauth.go

Version
v1.25.0-rc.1
Published
Jun 11, 2025
Platform
js/wasm
Imports
17 packages
Last checked
1 minute ago

Tools for package owners.