-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Cleanup go.mod handling of helpers #3576
Cleanup go.mod handling of helpers #3576
Conversation
Since `go.mod` in the root of helpers declares itself as: ``` module github.com/dependabot/dependabot-core/go_modules/helpers ``` then my understanding is there's no need to have custom replace directives... `go` is smart enough to realize that these are local pkgs and should be imported locally. As a result, we also no longer need a custom `go.mod` file within the subpackage. Which makes life easier as this subpackage declared an older version of the extracted go modules repo... which works, but can be confusing since there are two `go.mod` files with slightly different minimum supported versions. Avoid all that by treating this as a package of the parent modules rather than a standalone module.
This same cleanup could be applied to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, thanks for cleaning this up!
go mod graph
Pre
github.com/dependabot/dependabot-core/go_modules/helpers github.com/Masterminds/vcs@v1.13.1
github.com/dependabot/dependabot-core/go_modules/helpers github.com/dependabot/dependabot-core/go_modules/helpers/updater@v0.0.0
github.com/dependabot/dependabot-core/go_modules/helpers github.com/dependabot/gomodules-extracted@v1.2.0
github.com/dependabot/dependabot-core/go_modules/helpers golang.org/x/mod@v0.4.2
github.com/dependabot/dependabot-core/go_modules/helpers/updater@v0.0.0 github.com/dependabot/gomodules-extracted@v0.0.0-20181020215834-1b2f850478a3
golang.org/x/mod@v0.4.2 golang.org/x/crypto@v0.0.0-20191011191535-87dc89f01550
golang.org/x/mod@v0.4.2 golang.org/x/tools@v0.0.0-20191119224855-298f0cb1881e
golang.org/x/mod@v0.4.2 golang.org/x/xerrors@v0.0.0-20191011141410-1b5146add898
golang.org/x/crypto@v0.0.0-20191011191535-87dc89f01550 golang.org/x/net@v0.0.0-20190404232315-eb5bcb51f2a3
golang.org/x/crypto@v0.0.0-20191011191535-87dc89f01550 golang.org/x/sys@v0.0.0-20190412213103-97732733099d
golang.org/x/tools@v0.0.0-20191119224855-298f0cb1881e golang.org/x/net@v0.0.0-20190620200207-3b0461eec859
golang.org/x/tools@v0.0.0-20191119224855-298f0cb1881e golang.org/x/sync@v0.0.0-20190423024810-112230192c58
golang.org/x/tools@v0.0.0-20191119224855-298f0cb1881e golang.org/x/xerrors@v0.0.0-20190717185122-a985d3407aa7
golang.org/x/net@v0.0.0-20190404232315-eb5bcb51f2a3 golang.org/x/crypto@v0.0.0-20190308221718-c2843e01d9a2
golang.org/x/net@v0.0.0-20190404232315-eb5bcb51f2a3 golang.org/x/text@v0.3.0
golang.org/x/net@v0.0.0-20190620200207-3b0461eec859 golang.org/x/crypto@v0.0.0-20190308221718-c2843e01d9a2
golang.org/x/net@v0.0.0-20190620200207-3b0461eec859 golang.org/x/sys@v0.0.0-20190215142949-d0b11bdaac8a
golang.org/x/net@v0.0.0-20190620200207-3b0461eec859 golang.org/x/text@v0.3.0
golang.org/x/crypto@v0.0.0-20190308221718-c2843e01d9a2 golang.org/x/sys@v0.0.0-20190215142949-d0b11bdaac8a
Post:
github.com/dependabot/dependabot-core/go_modules/helpers github.com/Masterminds/vcs@v1.13.1
github.com/dependabot/dependabot-core/go_modules/helpers github.com/dependabot/gomodules-extracted@v1.2.0
github.com/dependabot/dependabot-core/go_modules/helpers golang.org/x/mod@v0.4.2
golang.org/x/mod@v0.4.2 golang.org/x/crypto@v0.0.0-20191011191535-87dc89f01550
golang.org/x/mod@v0.4.2 golang.org/x/tools@v0.0.0-20191119224855-298f0cb1881e
golang.org/x/mod@v0.4.2 golang.org/x/xerrors@v0.0.0-20191011141410-1b5146add898
golang.org/x/crypto@v0.0.0-20191011191535-87dc89f01550 golang.org/x/net@v0.0.0-20190404232315-eb5bcb51f2a3
golang.org/x/crypto@v0.0.0-20191011191535-87dc89f01550 golang.org/x/sys@v0.0.0-20190412213103-97732733099d
golang.org/x/tools@v0.0.0-20191119224855-298f0cb1881e golang.org/x/net@v0.0.0-20190620200207-3b0461eec859
golang.org/x/tools@v0.0.0-20191119224855-298f0cb1881e golang.org/x/sync@v0.0.0-20190423024810-112230192c58
golang.org/x/tools@v0.0.0-20191119224855-298f0cb1881e golang.org/x/xerrors@v0.0.0-20190717185122-a985d3407aa7
golang.org/x/net@v0.0.0-20190404232315-eb5bcb51f2a3 golang.org/x/crypto@v0.0.0-20190308221718-c2843e01d9a2
golang.org/x/net@v0.0.0-20190404232315-eb5bcb51f2a3 golang.org/x/text@v0.3.0
golang.org/x/net@v0.0.0-20190620200207-3b0461eec859 golang.org/x/crypto@v0.0.0-20190308221718-c2843e01d9a2
golang.org/x/net@v0.0.0-20190620200207-3b0461eec859 golang.org/x/sys@v0.0.0-20190215142949-d0b11bdaac8a
golang.org/x/net@v0.0.0-20190620200207-3b0461eec859 golang.org/x/text@v0.3.0
golang.org/x/crypto@v0.0.0-20190308221718-c2843e01d9a2 golang.org/x/sys@v0.0.0-20190215142949-d0b11bdaac8a
Diff:
2d1
< github.com/dependabot/dependabot-core/go_modules/helpers github.com/dependabot/dependabot-core/go_modules/helpers/updater@v0.0.0
5d3
< github.com/dependabot/dependabot-core/go_modules/helpers/updater@v0.0.0 github.com/dependabot/gomodules-extracted@v0.0.0-20181020215834-1b2f850478a3
@thepwagner just curious--why include the |
My intent was to demonstrate that nothing changes: by removing Completely unnecessary, but it was how I double-checked so I wanted to store it. |
Thanks, that makes sense. I'll keep that trick in mind for my own work. I'm always amazed how contributing to open source is often the best teacher of little tricks like this. |
Since
go.mod
in the root of helpers declares itself as:then my understanding is there's no need to have custom replace
directives...
go
is smart enough to realize that these are local pkgsand should be imported locally.
As a result, we also no longer need a custom
go.mod
file within thesubpackage.
Which makes life easier as this subpackage declared an older version of
the extracted go modules repo... which works, but can be confusing since
there are two
go.mod
files with slightly different minimum supportedversions. Avoid all that by treating this as a package of the parent
modules rather than a standalone module.