go/src/cmd/go/internal/modfetch/codehost/codehost.go

const MaxGoMod

const MaxLICENSE

const MaxZipFile

type Repo

type Origin

type Tags

type Tag

// isOriginTag reports whether tag should be preserved
// in the Tags method's Origin calculation.
// We can safely ignore tags that are not look like pseudo-versions,
// because ../coderepo.go's (*codeRepo).Versions ignores them too.
// We can also ignore non-semver tags, but we have to include semver
// tags with extra suffixes, because the pseudo-version base finder uses them.
func isOriginTag(tag string) bool {}

type RevInfo

type UnknownRevisionError

func (e *UnknownRevisionError) Error() string {}

func (UnknownRevisionError) Is(err error) bool {}

var ErrNoCommits

type noCommitsError

func (noCommitsError) Error() string {}

func (noCommitsError) Is(err error) bool {}

// AllHex reports whether the revision rev is entirely lower-case hexadecimal digits.
func AllHex(rev string) bool {}

// ShortenSHA1 shortens a SHA1 hash (40 hex digits) to the canonical length
// used in pseudo-versions (12 hex digits).
func ShortenSHA1(rev string) string {}

// WorkDir returns the name of the cached work directory to use for the
// given repository type and name.
func WorkDir(ctx context.Context, typ, name string) (dir, lockfile string, err error) {}

type RunError

func (e *RunError) Error() string {}

var dirLock

type RunArgs

// Run runs the command line in the given directory
// (an empty dir means the current directory).
// It returns the standard output and, for a non-zero exit,
// a *RunError indicating the command, exit status, and standard error.
// Standard error is unavailable for commands that exit successfully.
func Run(ctx context.Context, dir string, cmdline ...any) ([]byte, error) {}

// RunWithArgs is the same as Run but it also accepts additional arguments.
func RunWithArgs(ctx context.Context, args RunArgs) ([]byte, error) {}

var bashQuoter

func run(ctx context.Context, args RunArgs) ([]byte, error) {}