diff options
author | zowoq | 2021-07-31 14:57:54 +1000 |
---|---|---|
committer | zowoq | 2021-08-06 09:09:58 +1000 |
commit | b60dde0c1eadd1e62a5e26adb4c4b6c4e03050d2 (patch) | |
tree | 0d6140382130bc3eddc4bfd3e26e88a7da2427ee /doc/languages-frameworks | |
parent | ed6852a778fefd20ad667493f8d94b917ca76304 (diff) |
buildGo{Module,Package}: add `tags` argument
Simpler method of setting tags rather than using some combination of buildFlags, buildFlagsArray, preBuild, etc Using `lib.concatStringsSep ","` as space separated tags are deprecated in go.
Diffstat (limited to 'doc/languages-frameworks')
-rw-r--r-- | doc/languages-frameworks/go.section.md | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/doc/languages-frameworks/go.section.md b/doc/languages-frameworks/go.section.md index b20a8d0c3549..8bcbbd323e36 100644 --- a/doc/languages-frameworks/go.section.md +++ b/doc/languages-frameworks/go.section.md @@ -112,16 +112,6 @@ done Both `buildGoModule` and `buildGoPackage` can be tweaked to behave slightly differently, if the following attributes are used: -### `buildFlagsArray` and `buildFlags`: {#ex-goBuildFlags-noarray} - -These attributes set build flags supported by `go build`. We recommend using `buildFlagsArray`. - -```nix - buildFlagsArray = [ - "-tags=release" - ]; -``` - ### `ldflags` {#var-go-ldflags} Arguments to pass to the Go linker tool via the `-ldflags` argument of `go build`. The most common use case for this argument is to make the resulting executable aware of its own version. For example: @@ -134,6 +124,21 @@ Arguments to pass to the Go linker tool via the `-ldflags` argument of `go build ]; ``` +### `tags` {#var-go-tags} + +Arguments to pass to the Go via the `-tags` argument of `go build`. For example: + +```nix + tags = [ + "production" + "sqlite" + ]; +``` + +```nix + tags = [ "production" ] ++ lib.optionals withSqlite [ "sqlite" ]; +``` + ### `deleteVendor` {#var-go-deleteVendor} Removes the pre-existing vendor directory. This should only be used if the dependencies included in the vendor folder are broken or incomplete. |