Live data from Hacker News

Go += Package Versioning

research.swtch.com

11–20 of 213 posts

Re: Go += Package Versioning

#11
post #9

>End of GOPATH Yes yes yes yes finally! This has been the #1 reason I've avoided Go for years and even my recent forays back into the language were only after I figured out some hacks that I could use to avoid it.

For what reasons did you need to avoid it?

Some people want to store their projects in their own folder structure and not be forced to store it in the very weird way Go does it. I didn't avoid Go for this reason but I did find the whole Go workspace way it does things a big turnoff.

Re: Go += Package Versioning

#12
post #10

>End of GOPATH Yes yes yes yes finally! This has been the #1 reason I've avoided Go for years and even my recent forays back into the language were only after I figured out some hacks that I could use to avoid it.

I've been programming in Go for a couple of years now and found that this need to use "hacks ... to avoid it" is totally naive and irrational. Agreed, GOPATH is awkward--at first. Because it's different from what most programmers are used to. But once it's adopted it actually makes a lot of sense, and looking back it seems bizarre to ever have such a strong desire to avoid it at all costs--and the costs are high. The…

I should add that another big part of the reason I've been avoiding the language for years is the cult of Golang telling me my complaints are "totally naive and irrational".

Re: Go += Package Versioning

#13
Damn it. Just when dep seemed like it was going to finally end the horrible nightmare that is go dependency management, this comes along. There's this great survey of all the progress that had been made and then "but we're doing it in this bizarre terrible way because..."

Re: Go += Package Versioning

#14

>End of GOPATH Yes yes yes yes finally! This has been the #1 reason I've avoided Go for years and even my recent forays back into the language were only after I figured out some hacks that I could use to avoid it.

You say that because you have infinite filesystem space. I don't.

Re: Go += Package Versioning

#15

>End of GOPATH Yes yes yes yes finally! This has been the #1 reason I've avoided Go for years and even my recent forays back into the language were only after I figured out some hacks that I could use to avoid it.

Because you didn't want to set an env var?

GOPATH has a default. Unix: $HOME/go Windows: %USERPATH%/go

but on ci servers it could be akward.

Re: Go += Package Versioning

#16
post #14

>End of GOPATH Yes yes yes yes finally! This has been the #1 reason I've avoided Go for years and even my recent forays back into the language were only after I figured out some hacks that I could use to avoid it.

You say that because you have infinite filesystem space. I don't.

Though GOPATH avoids duplication, it's entirely possible to avoid duplication without GOPATH.

Re: Go += Package Versioning

#17

>End of GOPATH Yes yes yes yes finally! This has been the #1 reason I've avoided Go for years and even my recent forays back into the language were only after I figured out some hacks that I could use to avoid it.

Because you didn't want to set an env var?

> Because you didn't want to set an env var?

You haven't needed to set a GOPATH since 1.8, which was released over a year ago (we're now at 1.10). Since 1.8, the Go toolchain will use a default GOPATH; the environment variable is only needed as an override.

Re: Go += Package Versioning

#18
I like the removal of GOPATH, even though I don't mind it at all, it can be an annoyance, especially when I don't want to co-mingle work/personal stuff. Now I don't need to worry about setting GOPATH based on what I'm working on. Plus sometimes I'd wonder, is it all in vendor, or is it using GOPATH for something.

Plus now libraries are "modules" so libraries can have dependencies for specific versions, before the question is what do you do if multiple dependencies have the same dependencies in their own separate vendor directories. This change removes that, as it's handled by the vgo tool for all modules in that build.

go.mod is kind of a cross between lock-file and dependency listing. I think it will work alright.

All together, it seems to be a cross between gb and dep, while also attempting to solve library-packages tracking dependencies too.

Re: Go += Package Versioning

#19
> we also must not remove the best parts of the current go command: its simplicity, speed, and understandability.

Then you propose to introduce the concept of modules and make the world a hell?

I believe versioning should be left of to third-party tools. For example, no one is complaining about the lack of versioning built in Node.js.

Post reply on HN