Skip to content
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

mod: justify mod style #284

Closed
wants to merge 1 commit into from
Closed

mod: justify mod style #284

wants to merge 1 commit into from

Conversation

sysulq
Copy link

@sysulq sysulq commented Feb 20, 2019

In this way, we can get the right tag like v1.1.3, instead of pseudo-version

A good example would be shown below

https://github.com/stretchr/testify/blob/master/go.mod
https://github.com/andrewstuart/go-robinhood/blob/master/go.mod#L8

go-robinhood imports github.com/stretchr/testify/assert and got the right version

github.com/stretchr/testify v1.2.2

@sysulq
Copy link
Author

sysulq commented Feb 20, 2019

@ugorji please consider to merge this PR, thanks

@ugorji
Copy link
Owner

ugorji commented Feb 20, 2019

I don't understand why this is necessary, why it works, or what exactly it does.

What problem did it fix? Why do I need a go.sum that is very clearly incomprehensible to me, the author?

@sysulq
Copy link
Author

sysulq commented Feb 20, 2019

maybe this wiki would help you understand go.sum

https://github.com/golang/go/wiki/Modules#should-i-commit-my-gosum-file-as-well-as-my-gomod-file

and the key point here is to specify the module name as github.com/ugorji/go, which avoids pseudo-version like github.com/ugorji/go/codec v0.0.0-20190204201341-e444a5086c43.

etcd-io/etcd#10481 (diff)

@ugorji
Copy link
Owner

ugorji commented Feb 20, 2019 via email

@sysulq
Copy link
Author

sysulq commented Feb 20, 2019

yep, we could use codec as submodule of github.com/ugorji/go, which follows the go mod style better :-)

just like github.com/stretchr/testify did

@ugorji
Copy link
Owner

ugorji commented Feb 20, 2019

Right. But submodules are so ... intrusive and messes up the git history. I would rather wait a bit and let the bug be fixed, so that subdirectory works just as well.

@sysulq
Copy link
Author

sysulq commented Feb 20, 2019

this is just the rule declaimed by go mod, I do hope you merge this pull request to avoid pseudo-version, and submodule of go mod works perfectly, it's not the same thing like git submodules.

@ugorji
Copy link
Owner

ugorji commented Feb 20, 2019

This PR is not a submodules, I don't understand the changes in go.sum, and I don't know what it's fixing.

I can't merge that.

I will be happy to merge something that I understand and agree with how/what it fixes. Some if that requires some education of me.

@sysulq
Copy link
Author

sysulq commented Feb 20, 2019

alright, let's talk subdirectory instead of submodules...and the submodule I mentioned is just the same as package's subdirectory.

actually, the go.sum generated in this PR comes from https://github.com/golang/tools/blob/master/go.sum
because github.com/ugoji/go needs github.com/golang/tools.

as the go modules wiki said, go.sum is used to check the download copies and provides enough information for reproducible builds

go.sum contains the expected cryptographic checksums of the content of specific module versions.

If someone clones your repository and downloads your dependencies using the go command, they will receive an error if there is any mismatch between their downloaded copies of your dependencies and the corresponding entries in your go.sum.

Or if you do not accept the go.sum, I can even remove this, because this is not the key point of this PR... instead the go.mod file is

@sysulq
Copy link
Author

sysulq commented Feb 20, 2019

and this go.sum is auto generated by go mod tidy

@ugorji
Copy link
Owner

ugorji commented Feb 20, 2019

I don't know what you're fixing. Can you demonstrate a reproducer?

@ugorji
Copy link
Owner

ugorji commented Feb 20, 2019

See #279

@ugorji
Copy link
Owner

ugorji commented Feb 26, 2019

@hnlq715 can you please try this again with go 1.12 (just released)? Maybe that is why you see a problem, but I don't know what you see, so I cannot reproduce.

@ugorji
Copy link
Owner

ugorji commented Feb 26, 2019

Closing this, as I don't even know what it is trying to fix, or if there is a problem here, and OP is now unresponsive.

@ugorji ugorji closed this Feb 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants