buildGo{Module,Package}: warn if buildFlags is used

This commit is contained in:
zowoq 2021-08-01 08:00:39 +10:00
parent a6e2f2fc90
commit cb7d80dcaf
2 changed files with 10 additions and 0 deletions

View file

@ -46,6 +46,9 @@
# Not needed with buildGoModule
, goPackagePath ? ""
# needed for buildFlags warning
, buildFlags ? ""
, ... }@args':
with builtins;
@ -268,4 +271,6 @@ let
};
});
in
lib.warnIf (buildFlags != "")
"Use the `ldflags` and/or `tags` attributes instead of `buildFlags`"
package

View file

@ -43,6 +43,9 @@
, CGO_ENABLED ? go.CGO_ENABLED
# needed for buildFlags warning
, buildFlags ? ""
, meta ? {}, ... } @ args:
@ -257,4 +260,6 @@ let
} // meta;
});
in
lib.warnIf (buildFlags != "")
"Use the `ldflags` and/or `tags` attributes instead of `buildFlags`"
package