I recently started learning Go programming language for Web and now I can't build my project. I'm getting "inconsistent vendoring". I checked github and the library is missing i.e. (Actually the library is still there but with no v0.1.0) vscode error type on build
Run the following before go build
go mod tidy
go mod vendor
This problem can also occur if you vendor/modules.txt
file is missing. This happened in a project that gitignored *.txt
and the solution was simply to commit this file and then follow what @amit-basuri wrote in his answer.
On windows:
Initially, I had my packages in C\:Go\src
. It turns out that, go creates other directories in C:\Users\USERNAME\go\src\
. I therefore moved my (personal) packages into the C:\Users\USERNAME\go\src\
folder and those from github into the C:\Users\USERNAME\go\src\github.com
folder.
Everything started working again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With