-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
go module dependency changed back atomatically, which i don't want #36215
Comments
Duplicate of #33284 |
Some transitive dependency in your module graph already |
A little help here, thanks. ps: can |
That probably means that the In that case, |
Actually, in your animation there is an error message that seems to describe the problem. Please attach failure messages and other relevant data as text rather than (especially animated!) images. |
It't another project and the same result. the output is somewhat strange, the issue below mentioned the same. I'll try to find a way to write down more detailed steps to reproduce the problem |
Here is a demo project to prove it. mkdir demo
cd demo
go mod init demo
touch main.go
go get github.com/winjeg/go-commons # which will get the latest version 1.2.1 then you paste the following code into package main
import (
"fmt"
"github.com/winjeg/go-commons/uid"
)
func main() {
fmt.Println(uid.UUIDShort())
} then just run it use go get -u github.com/winjeg/[email protected] then you should notice the content of go.mod is already changed and then you try
go back and watch the file go.mod, the file changed back to version 1.2.1 automatically ps: |
Well here's your trouble. You apparently moved the Modules are (intentionally) immutable: the same version must always refer to the same bytes, forever, starting from when that version is first published. With the default
As far as I can tell, this is all working as designed. Module versions are immutable — don't expect to mutate them. |
First many thanks. At fist I thought the version is directly related to the tags that is tagged on the project. So, you cannot do a re-version unless you change the module name ? |
If there is a problem with a released version, then you can issue a patch release to fix the problem and upgrade to that. In some cases it may take a fair amount of work to upgrade a bad dependency completely away, but we're working on improving those cases in the future; see #34189, #24031, and related issues. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
1.13.1 YES
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Programmer
What did you expect to see?
when I change back to a lower version, using
go get
, it should not change back to the former version.What did you see instead?
every time i try to run or bulid my program, the version of the dependency
go-commons
changed back, no matter how hard i tried.I tried to clean up the gopath files as well.
The text was updated successfully, but these errors were encountered: