GO111MODULE: Managing Module Compatibility During Development
When working on a new feature or fixing a bug, developers may need to test changes against a development branch of a dependency. Using the GO111MODULE environment variable allows for this, but it can sometimes lead to errors.
Module Loading Error
When attempting to retrieve a development branch using "go get -u github.com/junegunn/fzf@devel" with GO111MODULE=on, an error may occur:
go: error loading module requirements
Root Cause
This error arises because one of the dependencies (gopkg.in/DATA-DOG/go-sqlmock.v1) is incompatible with the module path convention used by other dependencies. In version 1.3.3 of go-sqlmock, the use of non-version suffixed module paths violates the convention.
Workaround
To bypass this error and retrieve the devel branch of fzf without updating dependencies, execute the following command:
go get github.com/junegunn/fzf
Omit the "-u" flag to avoid fetching updates for dependencies.
Alternatively, you can update the dependencies as suggested in the open pull request: https://github.com/gdamore/tcell/pull/267
The above is the detailed content of GO111MODULE: How to Manage Module Compatibility When Working with Development Branches?. For more information, please follow other related articles on the PHP Chinese website!