Go - Customizing Go Binaries with Build Tags

Source:

In your source code put this as the first line:

1// +build tag_name

or (to include):

1//go:build tag_name

alternatively (to exclude):

1// +build !tag_name

Then build with:

1go build -tags tag_name

## Go experiments

Note

The experiments are available via build tags, so you can build with:

as of Go 1.22 the rangefunc experiment is available