Go Makefile


archy is an simple binary to determine current kernel and machine architecture, which wraps uname and alternatively can read from Go runtime stdlib for GOOS and GOARCH.

But, why!?

Some project might use Makefile to download their dependencies of GitHub releases. They often look like such:


In said Makefiles, usually the OS and architecture is variable-escaped, to match developer workstation or CI machine.
Unfortunately, that may not be as easy for the second link above, as the uname output is as such:

❯ uname -s
Darwin # URLs are case-sensitive

❯ uname -m
x86_64 # Needs amd64

One solution is to rely on go env {GOOS,GOARCH}, which outputs darwin and amd64 respectively, but it requires Go being installed, which is not applicable in non-Go projects.

archy removes that dependency on Go binary being present – you can find a working example in Makefile.


View Github