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

Use Go modules #3

Closed
mvdan opened this issue Jan 15, 2021 · 4 comments
Closed

Use Go modules #3

mvdan opened this issue Jan 15, 2021 · 4 comments

Comments

@mvdan
Copy link

mvdan commented Jan 15, 2021

This repository seems to use a vendor directory instead of modules, kind of how most people developed Go code 3-4 years ago. Is there a particular reason for that?

I'm happy to help you transition or answer questions. The official docs are at https://golang.org/ref/mod.

@CaptainDero
Copy link
Contributor

This repository seems to use a vendor directory instead of modules, kind of how most people developed Go code 3-4 years ago. Is there a particular reason for that?

May be old habits :) .
But there are plans to shift to modules.

I'm happy to help you transition or answer questions. The official docs are at https://golang.org/ref/mod.

Thanks for your offer.
Please share some good approach that no internet connection or any access is required to any repo during building. It should be able to compile on offline machine just by git clone or source download without any extra pings.

@mvdan
Copy link
Author

mvdan commented Jan 16, 2021

Well, in "module mode" a command like go build will only download dependencies which are not in the cache. If you run go mod download whenever go.mod changes or after a git clone/pull in the module, then a go build or go test should never download anything else.

You can still use go mod vendor to have something similar to the old-style vendoring. I'd discourage that in general, though, just because it's going to make the git repository unnecessarily large and doesn't really win you much. Builds with modules are already reproducible by default, without the need for vendor dirs :)

@CaptainDero
Copy link
Contributor

go mod vendor looks reasonable as it does not do extra pings and thus prevents some analytics on DERO users.

@mvdan
Copy link
Author

mvdan commented Jan 19, 2021

The vendor directory will only be used for people who build graviton directly, though. Anyone using graviton as a dependency will skip the vendor directory entirely, so they'd have to do their own vendoring or use their own proxy if they did not want to hit github.com or proxy.golang.org. So I'm not entirely sure the vendor directory here really wins you anything at all.

@mvdan mvdan closed this as completed Mar 23, 2022
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

No branches or pull requests

2 participants