Documentation
¶
Index ¶
Constants ¶
View Source
const ( LinuxTag = uint32(iota) << platformShift WindowsTag )
Values used to tag platform specific constants.
The value for Linux is zero so that existing constants do not change.
View Source
const ( Linux = "linux" Windows = "windows" )
View Source
const ( IsLinux = runtime.GOOS == "linux" IsWindows = runtime.GOOS == "windows" )
View Source
const Native = Linux
Variables ¶
This section is empty.
Functions ¶
func DecodeConstant ¶
Decode a platform and a value from a tagged constant.
func EncodeConstant ¶
Encode a platform and a value into a tagged constant.
Returns an error if platform is unknown or c is out of bounds.
func SelectVersion ¶
SelectVersion extracts the platform-appropriate version from a list of strings like `linux:6.1` or `windows:0.20.0`.
Returns an empty string and nil if no version matched or an error if no strings were passed.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.