diff --git a/pkgs/build-support/go/module.nix b/pkgs/build-support/go/module.nix index 30542b1d16c6..ea266422c6d8 100644 --- a/pkgs/build-support/go/module.nix +++ b/pkgs/build-support/go/module.nix @@ -223,18 +223,19 @@ lib.extendMkDerivation { GOTOOLCHAIN = "local"; CGO_ENABLED = args.env.CGO_ENABLED or go.CGO_ENABLED; - }; - GOFLAGS = - GOFLAGS - ++ - lib.warnIf (lib.any (lib.hasPrefix "-mod=") GOFLAGS) - "use `proxyVendor` to control Go module/vendor behavior instead of setting `-mod=` in GOFLAGS" - (lib.optional (!finalAttrs.proxyVendor) "-mod=vendor") - ++ - lib.warnIf (builtins.elem "-trimpath" GOFLAGS) - "`-trimpath` is added by default to GOFLAGS by buildGoModule when allowGoReference isn't set to true" - (lib.optional (!finalAttrs.allowGoReference) "-trimpath"); + GOFLAGS = toString ( + GOFLAGS + ++ + lib.warnIf (lib.any (lib.hasPrefix "-mod=") GOFLAGS) + "use `proxyVendor` to control Go module/vendor behavior instead of setting `-mod=` in GOFLAGS" + (lib.optional (!finalAttrs.proxyVendor) "-mod=vendor") + ++ + lib.warnIf (builtins.elem "-trimpath" GOFLAGS) + "`-trimpath` is added by default to GOFLAGS by buildGoModule when allowGoReference isn't set to true" + (lib.optional (!finalAttrs.allowGoReference) "-trimpath") + ); + }; inherit enableParallelBuilding;