···163163 inherit (go) GOOS GOARCH;
164164165165 GOFLAGS = GOFLAGS
166166- ++ lib.optional (!proxyVendor) "-mod=vendor"
167167- ++ lib.optional (!allowGoReference) "-trimpath";
166166+ ++ lib.warnIf (lib.any (lib.hasPrefix "-mod=") GOFLAGS) "use `proxyVendor` to control Go module/vendor behavior instead of setting `-mod=` in GOFLAGS"
167167+ (lib.optional (!proxyVendor) "-mod=vendor")
168168+ ++ lib.warnIf (builtins.elem "-trimpath" GOFLAGS) "`-trimpath` is added by default to GOFLAGS by buildGoModule when allowGoReference isn't set to true"
169169+ (lib.optional (!allowGoReference) "-trimpath");
168170 inherit CGO_ENABLED enableParallelBuilding GO111MODULE GOTOOLCHAIN;
169171170172 # If not set to an explicit value, set the buildid empty for reproducibility.
···196198 runHook postConfigure
197199 '');
198200199199- buildPhase = args.buildPhase or (''
201201+ buildPhase = args.buildPhase or (
202202+ lib.warnIf (buildFlags != "" || buildFlagsArray != "")
203203+ "Use the `ldflags` and/or `tags` attributes instead of `buildFlags`/`buildFlagsArray`"
204204+ lib.warnIf (builtins.elem "-buildid=" ldflags)
205205+ "`-buildid=` is set by default as ldflag by buildGoModule"
206206+ ''
200207 runHook preBuild
201208202209 exclude='\(/_\|examples\|Godeps\|testdata'
···313320 } // meta;
314321 });
315322in
316316-lib.warnIf (buildFlags != "" || buildFlagsArray != "")
317317- "Use the `ldflags` and/or `tags` attributes instead of `buildFlags`/`buildFlagsArray`"
318318-lib.warnIf (builtins.elem "-buildid=" ldflags) "`-buildid=` is set by default as ldflag by buildGoModule"
319319-lib.warnIf (builtins.elem "-trimpath" GOFLAGS) "`-trimpath` is added by default to GOFLAGS by buildGoModule when allowGoReference isn't set to true"
320320-lib.warnIf (lib.any (lib.hasPrefix "-mod=") GOFLAGS) "use `proxyVendor` to control Go module/vendor behavior instead of setting `-mod=` in GOFLAGS"
321321- package
323323+package