"You can build large projects with many repos using Go modules. "Also, I forgot to add, lots of my repos are binaries, so module things don't apply. How do I tell someone to download go.wit.com/apps/helloworld? I can't now with a single GO111MODULE=off go get. Can we have 'go download' or can go get be reverted to the prior behavior. I don't understand what is wrong with the way things worked before. Does it break something for someone?
Per https://go.dev/doc/go1.22#go-command:> go get is no longer supported outside of a module in the legacy GOPATH mode (that is, with GO111MODULE=off). Other build commands, such as go build and go test, will continue to work indefinitely for legacy GOPATH programs.This was discussed in https://go.dev/issue/60915, which simultaneously proposed to preserve `go build` and `go test` and to finish removing `go get` in GOPATH mode. (That proposal was a change to the plan stated in https://go.dev/blog/go116-module-changes, which said: “We plan to drop support for GOPATH mode in Go 1.17.” That clearly did not happen as planned in Go 1.17.)
The simplest way to download Go dependencies for code review and debugging is to run `go mod vendor` in your module or (newly added) `go work vendor` in your workspace. Also note that `go mod download -json` and `go list -m -json` now include origin information in most cases:
~$ go list -json -m go.uber.org/z...@v1.27.0
...
On Monday, March 4, 2024 at 8:44:14 AM UTC-6 Bryan C. Mills wrote:Per https://go.dev/doc/go1.22#go-command:> go get is no longer supported outside of a module in the legacy GOPATH mode (that is, with GO111MODULE=off). Other build commands, such as go build and go test, will continue to work indefinitely for legacy GOPATH programs.This was discussed in https://go.dev/issue/60915, which simultaneously proposed to preserve `go build` and `go test` and to finish removing `go get` in GOPATH mode. (That proposal was a change to the plan stated in https://go.dev/blog/go116-module-changes, which said: “We plan to drop support for GOPATH mode in Go 1.17.” That clearly did not happen as planned in Go 1.17.)Thank you for the helpful link to 60915.GO111MODULE=off go get <go-import-path> I used because it was a very easy way to git clone my programs and all the packages in the correct go import paths.If my go.work file is:How do I git clone the repos? I just don't seem to understand what I'm supposed to do.
I made the go path mapping to the git clone paths, so obviously I can write something to do this, but using 'go get' before to do the git clone was really easy! Especially since it got all the dependencies also.Again, thanks for the help,jcarrBTW,go list -json -m go.uber.org/zap@latest@latest doesn't show the URL so one can't really get the current URL sent from the go-import/go-source lines. Actually, it doesn't seem like "go list" hits the external authoritative server at all and maybe only looks at the local ~/go/pkg/ files.
The simplest way to download Go dependencies for code review and debugging is to run `go mod vendor` in your module or (newly added) `go work vendor` in your workspace. Also note that `go mod download -json` and `go list -m -json` now include origin information in most cases:~$ go list -json -m go.uber.org/z...@v1.27.0
..."VCS": "git",
"URL": "https://github.com/uber-go/zap",
--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/mxP3SKA5QoM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/17d6e3dd-4687-4474-b2cd-f44aa702f436n%40googlegroups.com.
Part of the intent with modules is that you do not need to do a full `git clone` of each dependency — you should really only need to do that if you need to author upstream changes yourself,
in which case you can use `git clone` directly (instead of having the `go` command do that).
The Go proxy doesn't necessary serve origin information for previously-fetched modules, but you can force the use of the upstream git server using `GOPROXY=direct`:$ go clean -modcache
$ GOPROXY=direct go list -json -m go.uber.org/zap@latest
Firstly, you can reference the other repos and use the latest "master"
version by writing "master" where the v.... verson is in the file,
then use "go mod tidy"
Second, you can use "go work" to create a workspace with multiple go
modules in it, so that you can develop with them without having to
constantly update the go.mod versions.
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/8a3d883a-039e-4a95-8fc4-ff9fc0b874c2n%40googlegroups.com.
It's not quite what you're after, but FWIW the gohack command (github.com/rogpeppe/gohack) knows enough to download arbitrary Go modules including the VCS checkout. You might find it useful, I guess.
Now that workspaces are a thing, it might be nice for it to add it to the current go.workfile rather than to go.mod, I guess.
The simplest way to download Go dependencies for code review and debugging is to run `go mod vendor` in your module or (newly added) `go work vendor` in your workspace. Also note that `go mod download -json` and `go list -m -json` now include origin information in most cases:~$ go list -json -m go.uber.org/z...@v1.27.0
..."VCS": "git",
"URL": "https://github.com/uber-go/zap",