Skip to content

Commit

Permalink
build: update revive to workaround non-exclusion of vendor
Browse files Browse the repository at this point in the history
This should be fixed in v1.6.2.
  • Loading branch information
vincentbernat committed Feb 16, 2025
1 parent 9321ef8 commit 362b072
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ an example on a more complex project.

## Dependencies

This example relies on modules to retrieve dependencies. This requires
use of Go 1.11 or more recent. To update a dependency, use `go get
DEPENDENCY@REVISION`.
This example relies on modules to retrieve dependencies. This requires use of Go
1.11 or more recent. To update a dependency, use `go get DEPENDENCY@REVISION` or
`go get -tool DEPENDENCY@REVISION` if this is a tool.

You can checkout tag [v0.6][] if you need compatibility down to Go 1.11 or tag
[v1.4][] if you need compatibility down to Go 1.16.
Expand Down
15 changes: 10 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,20 @@
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages."${system}";
go = pkgs.go_1_24;
in
{
# This does not use the Makefile, notably "version" subcommand won't work.
packages.default = pkgs.buildGo124Module {
packages.default = pkgs.buildGoModule.override { inherit go; } {
name = "hellogopher";
src = ./.;
vendorHash = "sha256-H94VW02vcAj1vUqbIH+Wq3a/KRm6b0NPRb1SJLDf9gg=";
tags = ["release"];
env.CGO_ENABLED = "0";
vendorHash = "sha256-Z3DQZ6bleZ3hs0r+WtvgZuFuqGsOJrjnZXRz1Wbyh8o=";
buildPhase = ''
make all
'';
installPhase = ''
mkdir -p $out/bin
cp bin/* $out/bin/.
'';
};
});
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require (
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/mgechev/dots v0.0.0-20210922191527-e955255bf517 // indirect
github.com/mgechev/revive v1.6.1 // indirect
github.com/mgechev/revive v1.6.2-0.20250213160722-a59a2288fd4e // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/spf13/afero v1.12.0 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ github.com/mgechev/dots v0.0.0-20210922191527-e955255bf517 h1:zpIH83+oKzcpryru8c
github.com/mgechev/dots v0.0.0-20210922191527-e955255bf517/go.mod h1:KQ7+USdGKfpPjXk4Ga+5XxQM4Lm4e3gAogrreFAYpOg=
github.com/mgechev/revive v1.6.1 h1:ncK0ZCMWtb8GXwVAmk+IeWF2ULIDsvRxSRfg5sTwQ2w=
github.com/mgechev/revive v1.6.1/go.mod h1:/2tfHWVO8UQi/hqJsIYNEKELi+DJy/e+PQpLgTB1v88=
github.com/mgechev/revive v1.6.2-0.20250213160722-a59a2288fd4e h1:UIQ3lKJH+kRNq3oHT4lZ6dc1Wod+sUhlUxMeN/LM6Z0=
github.com/mgechev/revive v1.6.2-0.20250213160722-a59a2288fd4e/go.mod h1:qZnwcNhoguE58dfi96IJeSTPeZQejNeoMQLUZGi4SW4=
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand Down

0 comments on commit 362b072

Please sign in to comment.