Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update generate_gomod step in makefile #80

Closed
wants to merge 1 commit into from
Closed

Update generate_gomod step in makefile #80

wants to merge 1 commit into from

Conversation

MartinForReal
Copy link
Contributor

update generate_gomod step in makefile

@roblaszczak
Copy link
Member

Hello, @MartinForReal. Can you add some context why the current method should be changed? :)

@sagikazarmark
Copy link
Contributor

sagikazarmark commented Jun 11, 2019

I don't really agree with the vendoring part. In case of a library it doesn't really matter. Also, it makes the repository larger, which in turn means longer installation time. Missed the fact that vendor/ is ignored.

Other then that I agree:

  • Regenerating the go.mod file seems to be an anti-pattern for multiple reasons
    • It does not work well with MVS if you always upgrade the lowest possible version to the latest. It will always upgrade the dependencies to their latest version, even if not necessary.
    • Reinitializing dependencies also means, that any custom configuration will be lost from go.mod
  • go get -u github.com/golang/protobuf/proto also seems like a bad move, since in case of go modules it upgrades all dependencies and writes it in the go.mod file. Again, in case of a library it's not necessary, leave that to the user.

Personally I think a go mod tidy from time to time should be enough.

When a direct dependency needs updating, I use go get PACKAGE (no -u). This will update the dependency to the latest available version and leaves indirect dependencies at their default version (which again: should be fine for a library).

@roblaszczak
Copy link
Member

Ok, we will work on it during splitting Pub/Subs to separated repositories. In that scenario, this repository will be almost free of external dependencies and Pub/Subs repos will contain only necessary dependencies == it will require to download only these dependencies that you will really need :)

@sagikazarmark
Copy link
Contributor

This thread might also be interesting for you: spf13/viper#707

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants