Home  >  Article  >  Backend Development  >  How to Resolve Dependency Conflicts When Using GO111MODULE=on and Updating a Package with its Development Branch?

How to Resolve Dependency Conflicts When Using GO111MODULE=on and Updating a Package with its Development Branch?

Barbara Streisand
Barbara StreisandOriginal
2024-10-28 02:19:02847browse

 How to Resolve Dependency Conflicts When Using GO111MODULE=on and Updating a Package with its Development Branch?

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn