Error - the version that go is trying to pull for that specific module that imports it is either outdated or invalid.
Solution - For example in my case i was getting this error below:
go: downloading github.com/myk4040okothogodo/tutorial/gen/go/proto/books v0.0.0-00010101000000-000000000000
github.com/myk4040okothogodo/tutorial/books imports
github.com/myk4040okothogodo/tutorial/books/server imports
github.com/myk4040okothogodo/tutorial/gen/go/proto/books: github.com/myk4040okothogodo/tutorial/gen/go/proto/books@v0.0.0-00010101000000-000000000000: invalid version: unknown revision 000000000000
as you can see above my module "github.com/myk4040okothogodo/tutorial/books/server" imports another module "github.com/myk4040okothogodo/tutorial/gen/go/proto/books:" this import throws the error above, so i go to my go.mod file and make the following changes:
1 module github.com/myk4040okothogodo/tutorial/books/server
2
3 go 1.18
4
5 replace github.com/myk4040okothogodo/tutorial/db => ../../db
6
7 replace github.com/myk4040okothogodo/tutorial/gen/go/proto/books => ../../gen/go/proto/books
8
9 require (
10 github.com/arangodb/go-driver v1.3.2
11 github.com/myk4040okothogodo/tutorial/db v0.0.0-00010101000000-000000000000
12 github.com/myk4040okothogodo/tutorial/gen/go/proto/books latest
13 google.golang.org/grpc v1.47.0
14 )
check above in line 12 where i put "latest" instead of the version number i.e "v0.0.0...."
I save the file and then i run "go mod tidy"
The compiler then changes the "latest" designation to an up to date version,i.e it will look as below after running the mod tidy command.
1 module github.com/myk4040okothogodo/tutorial/books/server
2
3 go 1.18
4
5 replace github.com/myk4040okothogodo/tutorial/db => ../../db
6
7 replace github.com/myk4040okothogodo/tutorial/gen/go/proto/books => ../../gen/go/proto/books
8
9 require (
10 github.com/arangodb/go-driver v1.3.2
11 github.com/myk4040okothogodo/tutorial/db v0.0.0-00010101000000-000000000000
12 github.com/myk4040okothogodo/tutorial/gen/go/proto/books v0.0.0-20220601171028-60237b9c9583
13 google.golang.org/grpc v1.47.0
14 )
PS: check the package where i make the changes, dont change the wrong imports