Home  >  Article  >  Backend Development  >  Here are a few question-based titles that fit the article\'s content: * \"GO111MODULE=on: Why am I Getting \'go: error loading module requirements\' When Using \'go get -u\'?\" * \"Mod

Here are a few question-based titles that fit the article\'s content: * \"GO111MODULE=on: Why am I Getting \'go: error loading module requirements\' When Using \'go get -u\'?\" * \"Mod

Susan Sarandon
Susan SarandonOriginal
2024-10-28 06:12:30474browse

Here are a few question-based titles that fit the article's content:

*

Module Loading Error: "go: error loading module requirements" with GO111MODULE=on

When attempting to retrieve the development branch of a GitHub repository (in this case, github.com/junegunn/fzf) using GO111MODULE=on go get -u, you may encounter the following error:

go: error loading module requirements

This error can occur when a dependency of the specified package (fzf in this example) has a non-canonical module path without a version suffix in its go.mod file.

Specifically, the dependency github.com/gdamore/tcell, required by fzf, includes a dependency on gopkg.in/DATA-DOG/go-sqlmock.v1. In version 1.3.3 of go-sqlmock, go modules were implemented without a version suffix, causing explicit version indication to fail.

Resolution

If you wish to work on the development package without updating its dependencies, use go get github.com/junegunn/fzf without the -u flag.

Alternatively, you can update the dependency to the latest version, which should resolve the issue:

go get -u gopkg.in/DATA-DOG/go-sqlmock.v1

Additional Notes

A pull request has been opened in the tcell repository to address this issue: https://github.com/gdamore/tcell/pull/267

The above is the detailed content of Here are a few question-based titles that fit the article\'s content: * \"GO111MODULE=on: Why am I Getting \'go: error loading module requirements\' When Using \'go get -u\'?\" * \"Mod. 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