Skip to content

Xmake also supports the construction of go programs, and also provides command support for creating empty projects:

sh
$ xmake create -l go -t console test
EXPLORER
src
main.go
xmake.lua
Lua xmake.lua
12345
add_rules("mode.debug", "mode.release")

target("test")
    set_kind("binary")
    add_files("src/*.go")

In v2.3.6 version, xmake has made some improvements to its build support, and also supports cross compilation of go. For example, we can compile windows programs on macOS and linux:

sh
$ xmake f -p windows -a x86

For more examples, see: Go Examples