buildGoModule: place GOFLAGS-related warnings around GOFLAGS specification

Avoid "global" warnings that complicates fixed-point arguments support.

+5 -5
+5 -5
pkgs/build-support/go/module.nix
··· 163 inherit (go) GOOS GOARCH; 164 165 GOFLAGS = GOFLAGS 166 - ++ lib.optional (!proxyVendor) "-mod=vendor" 167 - ++ lib.optional (!allowGoReference) "-trimpath"; 168 inherit CGO_ENABLED enableParallelBuilding GO111MODULE GOTOOLCHAIN; 169 170 # If not set to an explicit value, set the buildid empty for reproducibility. ··· 318 } // meta; 319 }); 320 in 321 - lib.warnIf (builtins.elem "-trimpath" GOFLAGS) "`-trimpath` is added by default to GOFLAGS by buildGoModule when allowGoReference isn't set to true" 322 - lib.warnIf (lib.any (lib.hasPrefix "-mod=") GOFLAGS) "use `proxyVendor` to control Go module/vendor behavior instead of setting `-mod=` in GOFLAGS" 323 - package
··· 163 inherit (go) GOOS GOARCH; 164 165 GOFLAGS = GOFLAGS 166 + ++ lib.warnIf (lib.any (lib.hasPrefix "-mod=") GOFLAGS) "use `proxyVendor` to control Go module/vendor behavior instead of setting `-mod=` in GOFLAGS" 167 + (lib.optional (!proxyVendor) "-mod=vendor") 168 + ++ lib.warnIf (builtins.elem "-trimpath" GOFLAGS) "`-trimpath` is added by default to GOFLAGS by buildGoModule when allowGoReference isn't set to true" 169 + (lib.optional (!allowGoReference) "-trimpath"); 170 inherit CGO_ENABLED enableParallelBuilding GO111MODULE GOTOOLCHAIN; 171 172 # If not set to an explicit value, set the buildid empty for reproducibility. ··· 320 } // meta; 321 }); 322 in 323 + package