Documentation ¶
Index ¶
- Variables
- func AltArch(arch string) string
- func NormArch(arch string) string
- func SameArch(a, b string) bool
- type Pair
- func (oa Pair) Alted() Pair
- func (oa Pair) ExeExt() string
- func (oa *Pair) MarshalJSON() (bb []byte, err error)
- func (oa *Pair) MarshalText() (bb []byte, err error)
- func (oa Pair) Normalized() Pair
- func (oa Pair) String() string
- func (oa *Pair) UnmarshalJSON(b []byte) (err error)
- func (oa *Pair) UnmarshalText(text []byte) (err error)
Constants ¶
This section is empty.
Variables ¶
var ErrInvalid = errors.New("invalid os-arch")
ErrInvalid is returned when a string representation of Pair is invalid
Functions ¶
func AltArch ¶
AltArch maps arch values to an alternative representations - 386 -> x32 - amd64 -> x64 - arm -> arm32 - arm64 -> arm64 (noop)
Types ¶
type Pair ¶
Pair contains a OS, architecture pair, typically pulled from runtime.GOOS and runtime.GOARCH
func ParseList ¶
ParseList parses one or more strings with comma-separated list of arches into a set of pairs, also supports some predefined values. All targets are normalized and only unique entries are returned.
func This ¶
func This() Pair
This returns runtime.GOOS, runtime.GOARCH pair, This is the pair for which the compiler is currently building
func (*Pair) MarshalJSON ¶
MarshalJSON is used when writing Pair into JSON streams
func (*Pair) MarshalText ¶
MarshalText implements TextMarshaler interface for Pair
func (Pair) Normalized ¶
Normalized converts Pair to its GO-normalized representation
func (*Pair) UnmarshalJSON ¶
UnmarshalJSON is used when reading Pair from JSON streams
func (*Pair) UnmarshalText ¶
UnmarshalText implements TextUnmarshaler interface for Pair