flake: build Go-parsing tools with the project's Go

goimports, gotools' goimports wrapper and golangci-lint-langserver were
on the nixpkgs default Go, whose parser rejects generic methods.
This commit is contained in:
Kristoffer Dalby 2026-08-25 10:56:02 +00:00 committed by Kristoffer Dalby
parent 941fd9ff4e
commit 820dc3001b

View file

@ -82,6 +82,18 @@
golines = prev.golines.override {
buildGoModule = buildGo;
};
# goimports and friends: they parse Go with the parser of the Go
# they were built with, so an older one rejects new syntax.
gotools = prev.gotools.override {
buildGoModule = buildGo;
# goimports is wrapped with this go on PATH for module lookups.
go = pkgs.go_latest;
};
golangci-lint-langserver = prev.golangci-lint-langserver.override {
buildGoModule = buildGo;
};
};
}
// flake-utils.lib.eachDefaultSystem
@ -106,6 +118,8 @@
gotests
gofumpt
gopls
gotools
ksh
ko
yq-go