platform

Constants & Variables

List var #

List is the list of all valid GOOS/GOARCH combinations, including known-broken ports.

var List = []OSArch{...}

distInfo var #

var distInfo = map[OSArch]osArchInfo{...}

Structs

OSArch struct #

An OSArch is a pair of GOOS and GOARCH values indicating a platform.

type OSArch struct {
GOOS string
GOARCH string
}

osArchInfo struct #

osArchInfo describes information about an OSArch extracted from cmd/dist and stored in the generated distInfo map.

type osArchInfo struct {
CgoSupported bool
FirstClass bool
Broken bool
}

Functions

ASanSupported function #

ASanSupported reports whether goos/goarch supports the address sanitizer option.

func ASanSupported(goos string, goarch string) bool

Broken function #

Broken reports whether goos/goarch is considered a broken port. (See https://go.dev/wiki/PortingPolicy#broken-ports.)

func Broken(goos string, goarch string) bool

BuildModeSupported function #

BuildModeSupported reports whether goos/goarch supports the given build mode using the given compiler. There is a copy of this function in cmd/dist/test.go.

func BuildModeSupported(compiler string, buildmode string, goos string, goarch string) bool

CgoSupported function #

CgoSupported reports whether goos/goarch supports cgo.

func CgoSupported(goos string, goarch string) bool

DefaultPIE function #

DefaultPIE reports whether goos/goarch produces a PIE binary when using the "default" buildmode. On Windows this is affected by -race, so force the caller to pass that in to centralize that choice.

func DefaultPIE(goos string, goarch string, isRace bool) bool

ExecutableHasDWARF function #

ExecutableHasDWARF reports whether the linked executable includes DWARF symbols on goos/goarch.

func ExecutableHasDWARF(goos string, goarch string) bool

FirstClass function #

FirstClass reports whether goos/goarch is considered a “first class” port. (See https://go.dev/wiki/PortingPolicy#first-class-ports.)

func FirstClass(goos string, goarch string) bool

FuzzInstrumented function #

FuzzInstrumented reports whether fuzzing on goos/goarch uses coverage instrumentation. (FuzzInstrumented implies FuzzSupported.)

func FuzzInstrumented(goos string, goarch string) bool

FuzzSupported function #

FuzzSupported reports whether goos/goarch supports fuzzing ('go test -fuzz=.').

func FuzzSupported(goos string, goarch string) bool

InternalLinkPIESupported function #

func InternalLinkPIESupported(goos string, goarch string) bool

MSanSupported function #

MSanSupported reports whether goos/goarch supports the memory sanitizer option.

func MSanSupported(goos string, goarch string) bool

MustLinkExternal function #

MustLinkExternal reports whether goos/goarch requires external linking with or without cgo dependencies.

func MustLinkExternal(goos string, goarch string, withCgo bool) bool

RaceDetectorSupported function #

RaceDetectorSupported reports whether goos/goarch supports the race detector. There is a copy of this function in cmd/dist/test.go. Race detector only supports 48-bit VMA on arm64. But it will always return true for arm64, because we don't have VMA size information during the compile time.

func RaceDetectorSupported(goos string, goarch string) bool

String method #

func (p OSArch) String() string

Generated with Arrow