News for hackers. Stuff that matters.
Re:Toward Go 2 by cdelsolar on Thursday July 13, 2017 @04:09PM (#14764721)
It shouldn't be. Set the GOPATH once and use any text editor.
Re:Toward Go 2 by Spiritus on Thursday July 13, 2017 @05:09PM (#14765270)
Except you have to set it every time you open a shell. You can’t put it into your .bashrc either unless you only ever work on one project. This workflow sucks:

    $ cd projects/foo
    $ export GOPATH=$PWD
    $ cd src/github.com/company/foo
    $ go build
Re:Toward Go 2 by cdelsolar on Thursday July 13, 2017 @05:11PM (#14765290)
OP was talking about getting started. I also don't understand why you can't use the same GOPATH across multiple projects, especially with godeps?
Re:Toward Go 2 by frik on Friday July 14, 2017 @12:10AM (#14767392)
Multiple unrelated Go projects in different GIT/SVN repositories. GOPATH experience is painful.
Re:Toward Go 2 by cdelsolar on Monday July 17, 2017 @11:47AM (#14789605)
Even if they are unrelated you can still use one GOPATH...
Re:Toward Go 2 by sethammons on Friday July 14, 2017 @08:53AM (#14769380)
I use one GOPATH and work on dozens of projects. I would hate it if I had to change GOPATH often. In Go, if you find yourself fighting the system, chances are you are doing it wrong.

'go get github/user/project && cd $GOPATH/github/user/project'.

And to avoid dependency issues, I use one of the many vendoring tools. Currently 'govend'.

Re:Toward Go 2 by frik on Saturday July 15, 2017 @04:44AM (#14775700)
You are limited to one repository. So all your Go projects have to live in one repo.

That's the issue, and it's a big design flaw - do away with this GOPATH

Re:Toward Go 2 by sethammons on Monday July 17, 2017 @01:34PM (#14790664)
I'm not following you. I work in multiple repos under multiple orgs. I have my personal stuff, my work stuff, projects I've pulled down to contribute towards, and libraries that I want to test out tweaks upon.

I don't have go/src/ checked in. Is that what you mean? If you do that, you are doing it wrong. I have many, many go/src/$org/$project directories, each of them have their own source control (most of which is different git repos). If I am working on my stuff, cd $GOPATH/src/github.com/sethgrid/$project. That is the repo under source control. Do any development I want, push up any changes to that repo. Rinse and repeat. I can then cd $GOPATH/src/github.com/sethgrid/$project2 and do the same. When I want to pull down $project3, I just `go get github.com/sethgrid/$project3` or manually clone it and I can cd over to it and work on it separately.

Maybe I'm not understanding your criticism.

Re:Toward Go 2 by JelteF on Friday July 14, 2017 @02:49AM (#14768030)
You should try out https://github.com/GetStream/vg, it handles managing of multiple gopaths in such a way that cding to a directory switches you automatically.