@@ -114,21 +114,24 @@ Both `buildGoModule` and `buildGoPackage` can be tweaked to behave slightly diff
114114
115115### `buildFlagsArray` and `buildFlags`: {#ex-goBuildFlags-noarray}
116116
117−These attributes set build flags supported by `go build`. We recommend using `buildFlagsArray`. The most common use case of these attributes is to make the resulting executable aware of its own version. For example:
117+These attributes set build flags supported by `go build`. We recommend using `buildFlagsArray`.
118118
119119```nix
120120 buildFlagsArray = [
121− # Note: single quotes are not needed.
122− "-ldflags=-X main.Version=${version} -X main.Commit=${version}"
121+ "-tags=release"
123122 ];
124123```
125124
125+### `ldflags` {#var-go-ldflags}
126+
127+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:
128+
126129```nix
127− buildFlagsArray = ''
128− -ldflags=
129− -X main.Version=${version}
130− -X main.Commit=${version}
131− '';
130+ ldflags = [
131+ "-s" "-w"
132+ "-X main.Version=${version}"
133+ "-X main.Commit=${version}"
134+ ];
132135```
133136
134137### `deleteVendor` {#var-go-deleteVendor}