Documentation ¶
Overview ¶
Package version provides the version that the binary was built at.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ExtraGitCommit = ""
ExtraGitCommit, if non-empty, is the git commit of a "supplemental" repository at which Tailscale was built. Its format is the same as gitCommit.
ExtraGitCommit is used to track the source revision when the main Tailscale repository is integrated into and built from another repository (for example, Tailscale's proprietary code, or the Android OSS repository). Together, GitCommit and ExtraGitCommit exactly describe what repositories and commits were used in a build.
var GitCommit = ""
GitCommit, if non-empty, is the git commit of the github.com/tailscale/tailscale repository at which Tailscale was built. Its format is the one returned by `git describe --always --exclude "*" --dirty --abbrev=200`.
var GitDirty bool
GitDirty is whether Go stamped the binary has having dirty version control changes in the working directory (debug.ReadBuildInfo setting "vcs.modified" was true).
var Long = ""
Long is a full version number for this build, of the form "x.y.z-commithash" for builds stamped in the usual way (see build_dist.sh in the root) or, for binaries built by hand with the go tool, it's of the form "1.23.0-dev20220316-t29837428937{,-dirty}" where "1.23.0" comes from ../VERSION.txt and the part after dev is YYYYMMDD of the commit time, and the part after -t is the commit hash. The dirty suffix is whether there are uncommitted changes.
var Short = ""
Short is a short version number for this build, of the form "x.y.z" for builds stamped in the usual way (see build_dist.sh in the root) or, for binaries built by hand with the go tool, it's like Long's dev form, but ending at the date part, of the form "1.23.0-dev20220316".
Functions ¶
func AtLeast ¶
AtLeast returns whether version is at least the specified minimum version.
Version comparison in Tailscale is a little complex, because we switched "styles" a few times, and additionally have a completely separate track of version numbers for OSS-only builds.
AtLeast acts conservatively, returning true only if it's certain that version is at least minimum. As a result, it can produce false negatives, for example when an OSS build supports a given feature, but AtLeast is called with an official release number as the minimum
version and minimum can both be either an official Tailscale version numbers (major.minor.patch-extracommits-extrastring), or an OSS build datestamp (date.YYYYMMDD). For Tailscale version numbers, AtLeast also accepts a prefix of a full version, in which case all missing fields are assumed to be zero.
func CmdName ¶
func CmdName() string
CmdName returns either the base name of the current binary using os.Executable. If os.Executable fails (it shouldn't), then "cmd" is returned.
func IsMacSysExt ¶
func IsMacSysExt() bool
IsMacSysExt whether this binary is from the standalone "System Extension" (a.k.a. "macsys") version of Tailscale for macOS.
func IsRace ¶
func IsRace() bool
IsRace reports whether the current binary was built with the Go race detector enabled.
func IsSandboxedMacOS ¶
func IsSandboxedMacOS() bool
IsSandboxedMacOS reports whether this process is a sandboxed macOS process. It is true for the Mac App Store and macsys (System Extension) version on macOS, and false for tailscaled-on-macOS.
func IsWindowsGUI ¶
func IsWindowsGUI() bool
IsWindowsGUI reports whether the current process is the Windows GUI.
Types ¶
This section is empty.