From bb419e051d19e04046085f6c7d4ec1f363086a64 Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Tue, 16 Feb 2021 03:53:04 +1000 Subject: [PATCH] buildGoModule: use assert for checking goPackagePath (#113046) also remove a `disabled` leftover from 26117ed4b78020252e49fe75f562378063471f71 --- pkgs/development/go-modules/generic/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/development/go-modules/generic/default.nix b/pkgs/development/go-modules/generic/default.nix index c0f10ab5d8f..8246eaefed4 100644 --- a/pkgs/development/go-modules/generic/default.nix +++ b/pkgs/development/go-modules/generic/default.nix @@ -34,14 +34,16 @@ , meta ? {} # Not needed with buildGoModule -, goPackagePath ? null +, goPackagePath ? "" , ... }@args': with builtins; +assert goPackagePath != "" -> throw "`goPackagePath` is not needed with `buildGoModule`"; + let - args = removeAttrs args' [ "overrideModAttrs" "vendorSha256" "disabled" ]; + args = removeAttrs args' [ "overrideModAttrs" "vendorSha256" ]; go-modules = if vendorSha256 != null then stdenv.mkDerivation (let modArgs = { @@ -240,7 +242,5 @@ let [ lib.maintainers.kalbasit ]; }; }); -in if (goPackagePath != null) then - throw "`goPackagePath` not needed with `buildGoModule`" -else +in package