Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckAll ¶
CheckAll calls Check on each Go module in a Git repository. It returns a map from module directory to the Result for that module. The git argument is the path to the git executable. If it is empty, CheckAll will look for "git" in PATH using exec.LookPath.
Types ¶
type Result ¶
type Result struct { // DefaultBranch is the name of the default branch of the repository, typically "main" or "master". // This is determined heuristically from the repository's remote refs. DefaultBranch string // LatestVersion is the highest semantic version tag in the repository. LatestVersion string // LatestCommit is the hash of the latest commit on the main branch. // Valid only when DefaultBranch is not empty. LatestCommit string // LatestCommitHasLatestVersion is true if the latest commit on the main branch is tagged with the highest semantic version. // Valid only when DefaultBranch and LatestVersion are both non-empty. LatestCommitHasLatestVersion bool // LatestCommitHasVersionTag is true if the latest commit on the main branch is tagged with any semantic version. // Valid only when DefaultBranch is not empty. LatestCommitHasVersionTag bool // LatestMajor, LatestMinor, LatestPatch are the major, minor, and patch components of the latest version tag. // Valid only when LatestVersion is not empty. LatestMajor, LatestMinor, LatestPatch int // LatestVersionIsPrerelease is true if the latest version tag is a prerelease. // Valid only when LatestVersion is not empty. LatestVersionIsPrerelease bool // LatestVersionUnstable is true if the latest version tag is unstable. // (I.e., the major version number is 0, or it is a prerelease.) // Valid only when LatestVersion is not empty. LatestVersionUnstable bool // Modpath is the import path of the Go module. Modpath string // ModpathMismatch is true if the trailing part of Modpath // (excluding any version suffix) // does not agree with ModuleSubdir. // In other words, if the module is in subdir foo/bar of its repository, // we'd expect Modpath to end with .../foo/bar. ModpathMismatch bool // ModuleSubdir is the subdir in the repository where the module lives. ModuleSubdir string // ModverResultCode is the result of a call to [modver.CompareGit] // on the latest tagged version and the latest commit on the main branch, // when those are different commits. // Valid only when DefaultBranch is not empty and LatestCommitHasVersionTag is false. ModverResultCode modver.ResultCode // ModverResultString is the string describing the result in ModverResultCode. // Valid only when DefaultBranch is not empty and LatestCommitHasVersionTag is false. ModverResultString string // NewMajor, NewMinor, NewPatch are the major, minor, and patch components of the recommended new version. // Valid when DefaultBranch is not empty and LatestCommitHasVersionTag is false, // or when there are not yet any version tags // (in which case the recommended new version is v0.1.0). NewMajor, NewMinor, NewPatch int // VersionPrefix is the prefix for version tags in the repository. // When the root of a Go module is in subdir foo/bar of its repository, // version tags must look like "foo/bar/v1.2.3"; // this field holds the "foo/bar/" part. VersionPrefix string // VersionSuffix is the status of the module path's version suffix. // Valid only when LatestVersion is not empty. // // Possible values are: // // - VSOK: the version suffix is required and present, and matches the major version of the latest version tag // - VSMismatch: the version suffix does not match the major version of the latest version tag // - VSMissing: a version suffix is required but missing // - VSUnwanted: a version suffix is present but not required VersionSuffix VersionSuffixStatus }
Result holds the results of a call to Check.
type VersionSuffixStatus ¶
type VersionSuffixStatus string
VersionSuffixStatus is a type for the possible values of Result.VersionSuffix.
const ( VSOK VersionSuffixStatus = "ok" VSMismatch VersionSuffixStatus = "mismatch" VSMissing VersionSuffixStatus = "missing" VSUnwanted VersionSuffixStatus = "unwanted" )
Possible values for Result.VersionSuffix.
Click to show internal directories.
Click to hide internal directories.