On Sunday, February 2, 2020 at 3:16:44 AM UTC+1, Randall O'Reilly wrote: > > Apologies for being really slow on the uptake here, but I’m just now > realizing that the master plan is to actually get rid of the GOPATH mode! > Is there any chance of possibly retaining it? Is it too much work to > maintain both modules and GOPATH modes? I have absolutely no qualms with > the modules and recognize that it is essential and a major improvement (and > a huge amount of work). > > But I really like GOPATH! See: https://divan.dev/posts/gopath/ for some > similar sentiments. > > In short, GOPATH is great for simple, transparent, easy access to the > source code, and in general it tends to work fine most of the time. I have > always thought of the modules as a kind of extra-hassle mode for “business > types” that really need reproducible builds all the time, whereas “casual / > lazy hackers” can just live in GOPATH and do just fine, especially when > mostly dealing with their own code space (and especially across multiple > packages). > > So far, I’ve just been treating modules as something to update whenever I > make an official tagged release, but that strategy seems to not work very > well in practice, and, being lazy, have just been advising my users to turn > GO111MODULE=off. I’ve also generally been ignoring discussions of modules > and apologize if this is a retread — just point me to the relevant > discussion (didn’t find it in a quick search, except maybe in golang issues > which are too long!) > > Has someone written a short guide to replicate the “live source” mode of > GOPATH within modules, so you can easily be updating code across multiple > packages (and repositories) without having to do a lot of extra work to get > one package to use the current version of the other etc? That at least > would be super handy, if it is possible. > > Currently I'm using a simple hack, taking advantage of git.
1. Set the GOPRIVATE goenv variable to the prefix of your projects. In my case it is github.com/perillo 2. Update ~/.gitconfig with an URL rewrite, to map https://<modulepath> to the local GOPATH using SSH. [url "ssh://manlio@localhost:/home/manlio/src/go/src/github.com/perillo/"] insteadOf = https://github.com/perillo/ One issue it that the go tool will never again get your modules from the network. I have set GO111MODULE=on. Manlio -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/c40f06c1-df80-4a52-983d-7bcbc02bc387%40googlegroups.com.