GO111MODULE=on Error: Resolving Dependency Conflicts
When setting GO111MODULE=on to enable Go modules and attempt to update a package with its development branch, you may encounter an "error loading module requirements" message. This error indicates a conflict in the dependencies of the package you're trying to update.
In this specific case, when running GO111MODULE=on go get -u github.com/junegunn/fzf@devel, the error occurs because one of fzf's dependencies, gopkg.in/DATA-DOG/go-sqlmock, has introduced a change in its go.mod file that affects versioning.
Version 1.3.3 of go-sqlmock removed the version suffix from its go.mod path. This means that explicit indication of the version is no longer expected, and the latest version will be used instead. However, some of go-sqlmock's dependents, such as gdamore/tcell, still rely on the previous versioning system.
As a result, when fzf tries to update its dependencies with -u, it attempts to load go-sqlmock with the missing version suffix and fails. To work around this issue, you can temporarily disable the -u flag when updating fzf while working on the development branch.
GO111MODULE=on go get github.com/junegunn/fzf
Alternatively, you can wait for the issue to be resolved in a future update to tcell. A pull request has been raised in the tcell repository to address this specific conflict.
The above is the detailed content of How to Resolve Dependency Conflicts When Using GO111MODULE=on and Updating a Package with its Development Branch?. For more information, please follow other related articles on the PHP Chinese website!