"go module @latest found but does not contain package" Issue
When using Go modules for the first time, you may encounter the error message:
module github.com/mkideal/cli@latest found (v0.2.2), but does not contain package github.com/mkideal/cli module github.com/mkideal/cli@latest found (v0.2.2), but does not contain package github.com/mkideal/cli/ext
This error occurs during go build and is not encountered during go get, indicating that the issue may not lie with the proxy settings or the Go module/package.
In this case, the root cause of the problem is a cached copy of the module metadata in the Go module cache. To resolve this, run the following command:
go clean -modcache
This command clears the Go module cache, allowing Go to download the latest metadata for the module and its dependencies. This ensures that the package versions and their contents are accurately reflected during the go build process.
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3