btrbk: add mainProgram
[NixPkgs.git] / pkgs / by-name / go / gofumpt / package.nix
blob697ab47010fe11f59c74a6f1caa6c824f3cf41e1
2   lib,
3   buildGoModule,
4   fetchFromGitHub,
5   nix-update-script,
6   testers,
7   gofumpt,
8 }:
10 buildGoModule rec {
11   pname = "gofumpt";
12   version = "0.7.0";
14   src = fetchFromGitHub {
15     owner = "mvdan";
16     repo = pname;
17     rev = "v${version}";
18     hash = "sha256-mJM0uKztX0OUQvynnxeKL9yft7X/Eh28ERg8SbZC5Ws=";
19   };
21   vendorHash = "sha256-kJysyxROvB0eMAHbvNF+VXatEicn4ln2Vqkzp7GDWAQ=";
23   CGO_ENABLED = "0";
25   ldflags = [
26     "-s"
27     "-X main.version=v${version}"
28   ];
30   checkFlags = [
31     # Requires network access (Error: module lookup disabled by GOPROXY=off).
32     "-skip=^TestScript/diagnose$"
33   ];
35   passthru = {
36     updateScript = nix-update-script { };
37     tests.version = testers.testVersion {
38       package = gofumpt;
39       version = "v${version}";
40     };
41   };
43   meta = with lib; {
44     description = "Stricter gofmt";
45     homepage = "https://github.com/mvdan/gofumpt";
46     changelog = "https://github.com/mvdan/gofumpt/releases/tag/v${version}";
47     license = licenses.bsd3;
48     maintainers = with maintainers; [
49       rvolosatovs
50       katexochen
51     ];
52     mainProgram = "gofumpt";
53   };