Search code examples
gogo-modules

Go Modules management


While I try to build I am getting the following error:

go.mod requires settings-management-service  but vendor/modules.txt does not include it.
run 'go mod tidy; go mod vendor' to sync

I tried running go mod tidy; go mod vendor, but didn't help.


Solution

  • First, try deleting your vendor folder, and then running go mod vendor again.

    If settings-management-service is a local dependency, check if you are importing it correctly. The first line of your go.mod file should show the name of your module. Considering the name is app, and settings-management-service is a internal module, it should be imported as :

    import "app/settings-management-service"
    

    Do check if all deps are being downloaded correctly, and run go mod download.