diff --git a/pkgs/build-support/go/module.nix b/pkgs/build-support/go/module.nix index 69a6121722d5..b9722cc413a6 100644 --- a/pkgs/build-support/go/module.nix +++ b/pkgs/build-support/go/module.nix @@ -320,10 +320,15 @@ lib.extendMkDerivation { } getGoDirs() { - local type; - type="$1" - if [ -n "$subPackages" ]; then - echo "$subPackages" | sed "s,\(^\| \),\1./,g" + local -r type="$1" + + # Support strucuredAttrs, they are not space seperated + local -a subPackagesArray + concatTo subPackagesArray subPackages + + # Outputs each element prefixed with './' if the array is not empty + if [[ ''${#subPackagesArray[@]} -gt 0 ]]; then + echo "''${subPackagesArray[*]/#/./}" else find . -type f -name \*$type.go -exec dirname {} \; | grep -v "/vendor/" | sort --unique | grep -v "$exclude" fi diff --git a/pkgs/by-name/ne/neo-cowsay/package.nix b/pkgs/by-name/ne/neo-cowsay/package.nix index efcb0d4c60b8..209951938481 100644 --- a/pkgs/by-name/ne/neo-cowsay/package.nix +++ b/pkgs/by-name/ne/neo-cowsay/package.nix @@ -15,6 +15,7 @@ buildGoModule (finalAttrs: { hash = "sha256-DmIjqBTIzwkQ8aJ6xCgIwjDtczlTH5AKbPKFUGx3qQ8="; }; + __structuredAttrs = true; vendorHash = "sha256-gBURmodXkod4fukw6LWEY+MBxPcf4vn/f6K78UR77n0="; modRoot = "./cmd";