Skip to content

Go

Build with Flox

Not only can you develop your software with Flox, but you can build it as well. See the builds concept page for more details.

Since the output of the build must be copied to the $out directory, you may either install the output directly to $out, or you may copy the executable there manually after running go build.

Install directly to $out:

[build.myproject]
command = '''
  GOBIN=$out/bin go install
'''

Copy the executable manually:

[build.myproject]
command = '''
  mkdir -p $out/bin
  go build
  cp ./myproject $out/bin/myproject
'''