nixpkgs/pkgs/development/tools/goimports-reviser/default.nix
stuebinm ff1a94e523 treewide: add meta.mainProgram to packages with a single binary
The nixpkgs-unstable channel's programs.sqlite was used to identify
packages producing exactly one binary, and these automatically added
to their package definitions wherever possible.
2024-03-19 03:14:51 +01:00

47 lines
1007 B
Nix

{ lib
, buildGoModule
, fetchFromGitHub
}:
buildGoModule rec {
pname = "goimports-reviser";
version = "3.6.4";
src = fetchFromGitHub {
owner = "incu6us";
repo = "goimports-reviser";
rev = "v${version}";
hash = "sha256-+GVC/qJnqWm5tsn2Y5BPafapp7ct9kqHWlDNxukEZsM=";
};
vendorHash = "sha256-z+FeAXPXKi653im2X2WOP1R9gRl/x7UBnndoEXoxdwA=";
CGO_ENABLED = 0;
subPackages = [ "." ];
ldflags = [
"-s"
"-w"
"-X=main.Tag=${src.rev}"
];
checkFlags = [
"-skip=TestSourceFile_Fix_WithAliasForVersionSuffix/success_with_set_alias"
];
preCheck = ''
# unset to run all tests
unset subPackages
# unset as some tests require cgo
unset CGO_ENABLED
'';
meta = with lib; {
description = "Right imports sorting & code formatting tool (goimports alternative)";
mainProgram = "goimports-reviser";
homepage = "https://github.com/incu6us/goimports-reviser";
license = licenses.mit;
maintainers = with maintainers; [ jk ];
};
}