All possible GOOS value?

what is goos golang
goos and goarch for mac
go build
amd64p32
golang cross compile
goarch x86_64
goos is not recognized as an internal or external command
runtime.goos windows

If I get it right, GOOS is determined when compile the source code.

To better support multiple OS, I'm interested in what GOOS could be.

Of course, there might be infinite possibilities of it, since Go is opensourced. So what I really want is a "common list".

Known values are:

  • windows
  • linux
  • darwin or freebsd or unix? I know that at least one of them must exist.

Note that those values are defined in src/go/build/syslist.go.

With Go 1.5 (Q3 2015), GOARCH will become much more complete. See commit 1eebb91 by Minux Ma (minux)

go/build: reserve GOARCH values for all common architectures

Whenever we introduce a new GOARCH, older Go releases won't recognize them and this causes trouble for both our users and us (we need to add unnecessary build tags).

Go 1.5 has introduced three new GOARCHes so far: arm64 ppc64 ppc64le, we can take the time to introduce GOARCHes for all common architectures that Go might support in the future to avoid the problem.

const goosList = "android darwin dragonfly freebsd linux nacl \ 
  netbsd openbsd plan9 solaris windows "

const goarchList = "386 amd64 amd64p32 arm arm64 ppc64 ppc64le \
   mips mipsle mips64 mips64le mips64p32 mips64p32le \ # (new)
   ppc s390 s390x sparc sparc64 " # (new)

The list is still being review in Change 9644, with comments like:

I wouldn't bother with Itanium. It's basically a dead architecture. Plus, it's so hard to write a compiler for it that I really can't see it happening except as a labor of love, and nobody loves the Itanium.

The official documentation now (GO 1.5+ Q3 2015) reflects that completed list.


Update 2018: as documented in Giorgos Oikonomou's answer, Go 1.7 (Q1 2016) has introduced the go tool dist list command. See commit c3ecded: it fixes issue 12270 opened in Q3 2015:

To easier write tooling for cross compiling it would be good to programmatically get the possible combinations of GOOS and GOARCH.

This was implemented in CL 19837

cmd/dist: introduce list subcommand to list all supported platforms

You can list in plain text, or in json:

> go tool dist list -json
[
        {
                "GOOS": "android",
                "GOARCH": "386",
                "CgoSupported": true
        },
        ...
]

As Mark Bates tweeted:

Bonus: Column output properly formatted for display:

go tool dist list | column -c 75 | column -t

Go (Golang) GOOS and GOARCH � GitHub, Note that those values are defined in src/go/build/syslist.go . With Go 1.5 (Q3 2015), GOARCH will become much more complete. See commit 1eebb91 by Minux� In Go, these operating systems are possible values for the environment variable GOOS, pronounced “goose”, which stands for Go Operating System. The second part, after the /, is the architecture. As before, these are all possible values for an environment variable: GOARCH. This is pronounced “gore-ch”, and stands for Go Architecture.

I think you're looking for this list of possible GOOS and GOARCH combinations, in this section:

http://golang.org/doc/install/source#environment

$GOOS and $GOARCH The name of the target operating system and compilation architecture. These default to the values of $GOHOSTOS and $GOHOSTARCH respectively (described below).

Choices for $GOOS are darwin (Mac OS X 10.8 and above and iOS), dragonfly, freebsd, linux, netbsd, openbsd, plan9, solaris and windows. Choices for $GOARCH are amd64 (64-bit x86, the most mature port), 386 (32-bit x86), arm (32-bit ARM), arm64 (64-bit ARM), ppc64le (PowerPC 64-bit, little-endian), ppc64 (PowerPC 64-bit, big-endian), mips64le (MIPS 64-bit, little-endian), and mips64 (MIPS 64-bit, big-endian). mipsle (MIPS 32-bit, little-endian), and mips (MIPS 32-bit, big-endian).

The valid combinations of $GOOS and $GOARCH are:

$GOOS $GOARCH
android   arm
darwin    386
darwin    amd64
darwin    arm
darwin    arm64
dragonfly amd64
freebsd   386
freebsd   amd64
freebsd   arm
linux     386
linux     amd64
linux     arm
linux     arm64
linux     ppc64
linux     ppc64le
linux     mips
linux     mipsle
linux     mips64
linux     mips64le
netbsd    386
netbsd    amd64
netbsd    arm
openbsd   386
openbsd   amd64
openbsd   arm
plan9     386
plan9     amd64
solaris   amd64
windows   386
windows   amd64

Building Go Applications for Different Operating Systems and , All of the following information is based on go version go1.8.3 darwin/amd64 . A list of valid GOOS values. (Bold = supported by go out of the� A DCF is all about the idea that a dollar in the future is less valuable than a dollar today, so we need to discount the sum of these future cash flows to arrive at a present value estimate: 10

You can see the list of supported platform by running:

go tool dist list

and this will print(depending on the Go version):

android/386
android/amd64
android/arm
android/arm64
darwin/386
darwin/amd64
darwin/arm
darwin/arm64
dragonfly/amd64
freebsd/386
freebsd/amd64
freebsd/arm
linux/386
linux/amd64
linux/arm
linux/arm64
linux/mips
linux/mips64
linux/mips64le
linux/mipsle
linux/ppc64
linux/ppc64le
linux/s390x
nacl/386
nacl/amd64p32
nacl/arm
netbsd/386
netbsd/amd64
netbsd/arm
openbsd/386
openbsd/amd64
openbsd/arm
plan9/386
plan9/amd64
plan9/arm
solaris/amd64
windows/386
windows/amd64

And the official documentation for the tool:

https://godoc.org/github.com/golang/go/src/cmd/dist

To cross compile use:

GOOS=darwin GOARCH=386 go build main.go

All possible GOOS value?, By using the GOOS and GOARCH environment variables and build tags, As before, these are all possible values for an environment variable:� All comments and likes are very appreciated. _____ Canada Goose (NYSE: GOOS) is a vertically integrated 63-year-old manufacturer and retailer of outdoor apparel for men, women, and children-- traditionally known for the famous parka.

All possible GOOS value? - Golang, If I get it right, GOOS is determined when compile the source code. To better support multiple OS, I'm interested in what GOOS could be. Of course, there might � Canada goos was up 20% during pre-market and it went down 10% in price immediately after the conference call yesterday. People were fearful of the statement by CEO saying that there is a

What's a good value for R-squared?, If I get it right, GOOS is determined when compile the source code. To better support multiple OS, I'm interested in what GOOS could be. Of course, there might � See All Buying Options Available at a lower price from other sellers that may not offer free Prime shipping. Six Myths about the Good Life focuses on the values that are worth aiming for in our lives, a topic central to what has been called Philosophy of Life.

Core Values List: Over 200 Personal Values to Live By Today, Stepwise and all-possible-regressions � Excel file It may make a good complement if not a substitute for whatever regression software you are currently using,� For example, by noting that, even if it is true that only states have intrinsic value, it may yet be that not all states have intrinsic value, Zimmerman suggests (to put matters somewhat roughly) that basic intrinsic value is the intrinsic value had by states none of whose proper parts have intrinsic value (Zimmerman 2001, ch. 5).

Comments
  • You had selected the right answer before, and I detailed go tool dist list
  • @VonC Sure. Thanks for the update.
  • This is very promising! And I'll accept this answer as correct when Go 1.5 is released.
  • I changed the selection of correct answer, because I think official document is better at this.
  • @liuyanghejerry the doc link? OK, I have added it to my answer. Is my answer ok now?
  • Yes, I've changed it back to yours. Thank you.
  • I think it's a pretty new method along with some new version of Go? Do you have official document for it?