Live data from Hacker News

A simple virtualenv for Go

github.com

31–36 of 36 posts

Re: A simple virtualenv for Go

#31
post #22
post #7

Earlier quoted context omitted.

Naw, just go ahead and commit that if you like. That's too much easier to be worth the fork/checkout/commit/push/pull request cycle work in this case.

Understandable - but it's pretty easy to do small modifications like that using Github's edit feature. Everything but the editing itself is pretty much hidden away.

Did not know that. Thanks!

Re: A simple virtualenv for Go

#32

Genuine curiosity: In practice, which Go packages that people use require conflicting versions, necessitating a use for this tool? In my experience, Go developers are generally good about building against updated versions of packages. Combining that with the fact that binaries are all compiled and statically linked (as opposed to dynamically linked or interpreted), I can't remember ever running into the problem where…

In my case I've been using the excellent goandroid (https://github.com/eliasnaur/goandroid) to develop Android apps with Go and the NDK.

It's kind of a pain jumping around distributions manually, which is why I use Gobrew to manage my goandroid Go environment and my normal Go environment.

Re: A simple virtualenv for Go

#33
post #19
post #17

I'm actually a little confused by go's global approach, which ultimately gives rise to the myriad of solutions listed in the comments here. Am I missing some go-centric way of thinking?

I think the documentation about go workspaces is just a simple approach and it's expected the community will eventually settle on a way to manage this in a non-global fashion. I'm guessing everyone wants something slightly different and it would be pointless for Go to have One Way hence all the alternatives here.

[deleted]

Re: A simple virtualenv for Go

#34
post #19
post #17

I'm actually a little confused by go's global approach, which ultimately gives rise to the myriad of solutions listed in the comments here. Am I missing some go-centric way of thinking?

I think the documentation about go workspaces is just a simple approach and it's expected the community will eventually settle on a way to manage this in a non-global fashion. I'm guessing everyone wants something slightly different and it would be pointless for Go to have One Way hence all the alternatives here.

What makes the recommended approach in the workspace documentation "global"?

Re: A simple virtualenv for Go

#36
Another option is to use direnv (http://direnv.net).

Just add this to your .envrc in your project's folder:

    PATH_add bin
    GOPATH="$PWD"
The environment is automatically loaded or unloaded whenever you enter or leave the directory.

EDIT: Disclaimer, I'm the main author of direnv

Post reply on HN