go mod init example.com/program
go mod tidy
go build
The go tool will see the "github.com/foo/bar" path in the import statements, download the code from the repository, compile and everything will work.Now, let's say the "github.com/foo/bar" module gets a backwards-incompatible change, but does not change the import path, and you attempt to do the above process again. This time, the go tool will download the incompatible version of "github.com/foo/bar" and the build will fail - or even worse, succeed but have some logic bugs that will go unnoticed until some massive shit happens.