All of a sudden, I can’t compile a Go project (I maintain) with go get and go build, I get all kinds of very persistent errors. When running go build:
cmd/pistol/main.go:10:2: no required module provides package github.com/adrg/xdg; to add it:
go get github.com/adrg/xdg
cmd/pistol/main.go:9:2: no required module provides package github.com/alexflint/go-arg; to add it:
go get github.com/alexflint/go-arg
cmd/pistol/main.go:8:2: no required module provides package github.com/doronbehar/magicmime; to add it:
go get github.com/doronbehar/magicmime
previewer.go:15:2: no required module provides package al.essio.dev/pkg/shellescape; to add it:
go get al.essio.dev/pkg/shellescape
internal_writers/archives.go:14:2: no required module provides package github.com/dustin/go-humanize; to add it:
go get github.com/dustin/go-humanize
internal_writers/archives.go:12:2: no required module provides package github.com/jedib0t/go-pretty/v6/table; to add it:
go get github.com/jedib0t/go-pretty/v6/table
internal_writers/archives.go:11:2: no required module provides package github.com/mholt/archives; to add it:
go get github.com/mholt/archives
internal_writers/json.go:10:2: no required module provides package github.com/nwidger/jsoncolor; to add it:
go get github.com/nwidger/jsoncolor
internal_writers/archives.go:13:2: no required module provides package github.com/sirupsen/logrus; to add it:
go get github.com/sirupsen/logrus
internal_writers/archives.go:9:2: no required module provides package golang.org/x/term; to add it:
go get golang.org/x/term
And if I run go mod tidy I get:
go: finding module for package al.essio.dev/pkg/shellescape
go: finding module for package github.com/mholt/archives
go: finding module for package github.com/adrg/xdg
go: finding module for package github.com/doronbehar/magicmime
go: finding module for package github.com/alexflint/go-arg
go: finding module for package github.com/sirupsen/logrus
go: finding module for package github.com/jedib0t/go-pretty/v6/table
go: finding module for package github.com/dustin/go-humanize
go: finding module for package github.com/nwidger/jsoncolor
go: finding module for package golang.org/x/term
go: finding module for package github.com/alecthomas/assert/v2
go: finding module for package github.com/alecthomas/repr
go: github.com/doronbehar/pistol imports
al.essio.dev/pkg/shellescape: module al.essio.dev/pkg/shellescape@latest found (v1.6.0), but does not contain package al.essio.dev/pkg/shellescape
go: github.com/doronbehar/pistol imports
github.com/doronbehar/magicmime: package github.com/doronbehar/magicmime provided by github.com/doronbehar/magicmime at latest version v0.1.0 but not at required version v0.1.1-0.20211127135329-3de4ff29dc49
go: github.com/doronbehar/pistol imports
github.com/sirupsen/logrus: module github.com/sirupsen/logrus@latest found (v1.9.4), but does not contain package github.com/sirupsen/logrus
go: github.com/doronbehar/pistol/cmd/pistol imports
github.com/adrg/xdg: module github.com/adrg/xdg@latest found (v0.5.3), but does not contain package github.com/adrg/xdg
go: github.com/doronbehar/pistol/cmd/pistol imports
github.com/alexflint/go-arg: module github.com/alexflint/go-arg@latest found (v1.6.1), but does not contain package github.com/alexflint/go-arg
go: github.com/doronbehar/pistol/internal_writers imports
github.com/dustin/go-humanize: module github.com/dustin/go-humanize@latest found (v1.0.1), but does not contain package github.com/dustin/go-humanize
go: github.com/doronbehar/pistol/internal_writers imports
github.com/jedib0t/go-pretty/v6/table: module github.com/jedib0t/go-pretty/v6@latest found (v6.7.10), but does not contain package github.com/jedib0t/go-pretty/v6/table
go: github.com/doronbehar/pistol/internal_writers imports
github.com/mholt/archives: module github.com/mholt/archives@latest found (v0.1.5), but does not contain package github.com/mholt/archives
go: github.com/doronbehar/pistol/internal_writers imports
github.com/nwidger/jsoncolor: module github.com/nwidger/jsoncolor@latest found (v0.3.2), but does not contain package github.com/nwidger/jsoncolor
go: github.com/doronbehar/pistol/internal_writers imports
golang.org/x/term: module golang.org/x/term@latest found (v0.43.0), but does not contain package golang.org/x/term
go: github.com/doronbehar/pistol/internal_writers imports
github.com/alecthomas/chroma/v2 tested by
github.com/alecthomas/chroma/v2.test imports
github.com/alecthomas/assert/v2: module github.com/alecthomas/assert/v2@latest found (v2.11.0), but does not contain package github.com/alecthomas/assert/v2
go: github.com/doronbehar/pistol/internal_writers imports
github.com/alecthomas/chroma/v2/lexers tested by
github.com/alecthomas/chroma/v2/lexers.test imports
github.com/alecthomas/repr: module github.com/alecthomas/repr@latest found (v0.5.2), but does not contain package github.com/alecthomas/repr
I tried e.g:
sudo rm -rf ~/.go && go mod tidy -venv GOPROXY=direct go mod tidy -v
And all of these failed the same.
Luckily, since I use Nix with gomod2nix, I am able to build my project with nix build. However performing version bumps for go modules is impossible now…
Any idea why is that?