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

cmd/go: Add some way to work on offline Go modules #40912

Closed
Keithcat1 opened this issue Aug 19, 2020 · 3 comments
Closed

cmd/go: Add some way to work on offline Go modules #40912

Keithcat1 opened this issue Aug 19, 2020 · 3 comments

Comments

@Keithcat1
Copy link

Currently, it's hard to work with offline Go modules.
The problem is, I don't have internet at home, so there is no way for me to make a change to the Go module I'm working on, because I can't push it to Github, which means that any projects I'm working on will continue to use the old version of my Go module.
Ideally, there would be a command that, if the current directory was part of a Go module, would update the Go module cash with any new changes / versions to the current Go module.

@mjgarton
Copy link
Contributor

Perhaps something like this example might help you?

$ go mod edit -replace foo.com/bar/baz=/home/go/src/foo.com/bar/baz

This would update your go.mod to refer to a local copy of foo.com/bar/baz instead of the usual one.

@bcmills
Copy link
Contributor

bcmills commented Aug 20, 2020

To get the modules offline in the first place, presumably you would git clone them (or similar).
This then reduces to making multiple interlocking edits to those modules.

@bcmills
Copy link
Contributor

bcmills commented Aug 20, 2020

Duplicate of #27542

@bcmills bcmills marked this as a duplicate of #27542 Aug 20, 2020
@bcmills bcmills closed this as completed Aug 20, 2020
@golang golang locked and limited conversation to collaborators Aug 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants