Live data from Hacker News

Go 1.11 got me to stop ignoring Go

drewdevault.com

11–20 of 79 posts

Re: Go 1.11 got me to stop ignoring Go

#11
post #5

Earlier quoted context omitted.

That's not the point: https://news.ycombinator.com/item?id=18178987

And just what point is that? The article states that "You see, GOPATH crossed a line. " Doesn't explain what that line is and then goes on to say that Golang is an awesome and simple language.

He says it in the next sentence.

"...but with GOPATH its opinions extended beyond my Go work and into the rest of my system. [...] I already have opinions about how to use my computer."

Re: Go 1.11 got me to stop ignoring Go

#12
I whole heartedly agree with the author.

While I disagree with GO's style guide and a ton of other choices - I don't mind following them since that's what the language requires. But it goes past that and wants me to organize everything my working directory just for it - it's absolutely crossing a line.

While I didn't stop using Go because of GOPATH, it's one of those things that absolutely annoyed the crap out of me.

to the point that all my go projects are now organized as `project_name/go/src/github.com/username/project_name` as an example.

This was really really annoying to say the least.

Re: Go 1.11 got me to stop ignoring Go

#13
post #2

GOPATH issues - Elaborate more?

Apparently too lazy to set an environment variable. I found GOPATH annoying but not using Golang simply for that seems absurd to me.

Toggling GOPATH between projects is a huge pain, it's not as simple as set it once and forget it.

Re: Go 1.11 got me to stop ignoring Go

#14
post #2

GOPATH issues - Elaborate more?

Your go code has to live in go's directory structure. If your project is github.com/jrockway/whatever, then your source code must live in ~/go/src/github.com/jrockway/whatever/. There is no other place you can put it (though you can change ~/go to something else by setting $GOPATH in your environment).

I assume what upsets people is that everything in go is in a global namespace. So if you have ~/foo-project with some go in it, that doesn't work; you can't import things from there and the compiler won't build it. Instead you have to position it in the "global" ~/go/src for anything to work.

I used to teach Perl classes and people were equally upset about the concept of @INC. They did not want to manage packages that way, and the programming language did not give them a choice. This is very off-putting to some people.

(Me, I don't care. Not having 8000 configuration options to let the compiler find some github project I'm using is wonderful, even if having to cd go; cd src; cd github.com; cd jrockway; cd project; is kind of a lot of typing to get to the thing you're working on. I have a bash alias to get there ;)

Re: Go 1.11 got me to stop ignoring Go

#15

> I have major gripes with PEP-8, and if you ever see me using it I want you to shoot me in the face. That sounds extreme. I've never heard this before. Why?

IIRC, pep8 would have you write:

    def my_very_very_very_very_very_long_function_name(self,
                                                       param1,
                                                       param2):

Re: Go 1.11 got me to stop ignoring Go

#16

Earlier quoted context omitted.

And just what point is that? The article states that "You see, GOPATH crossed a line. " Doesn't explain what that line is and then goes on to say that Golang is an awesome and simple language.

He says it in the next sentence. "...but with GOPATH its opinions extended beyond my Go work and into the rest of my system. [...] I already have opinions about how to use my computer."

Not sure I agree with that statement. Yes Golang has an opinion on where it wants you to keep your go code but it dosen't effect the rest of your system, just your go work.

Re: Go 1.11 got me to stop ignoring Go

#17
post #2

GOPATH issues - Elaborate more?

Your go code has to live in go's directory structure. If your project is github.com/jrockway/whatever, then your source code must live in ~/go/src/github.com/jrockway/whatever/ . There is no other place you can put it (though you can change ~/go to something else by setting $GOPATH in your environment). I assume what upsets people is that everything in go is in a global namespace. So if you have ~/foo-project with so…

One nit: it's not "global" because it comes from $GOPATH. If you want, you can create a project like this: `~/myproject/src/app/main.go` and it will work fine so long as you set `GOPATH=$HOME/myproject` for your current shell.

Re: Go 1.11 got me to stop ignoring Go

#18
I have used goinstall, go get (in GOPATH), godep, dep, multiple GOPATHs, symlinks, git submodules and lots more to figure out dependencies in Go, and modules is FINALLY something that actually makes sense.

Re: Go 1.11 got me to stop ignoring Go

#19
post #8
post #2

GOPATH issues - Elaborate more?

Go insists that all of your Go code must live inside of a single hierarchy under $GOPATH. This pretty much forces you to organise files in your system in a very particular way, where the language a project is written in takes precedence over any other organisational concerns, and doesn't play well with, e.g. my setup, where I file my projects in a hierarchy shaped like ~/dev/{personal,$COMPANY,3rdparty}/$PROJECT_NAME…

I have multiple different languages and code for multiple companies and have no issues. I guess the issue is that you don't want to include the repo location in the path?

Re: Go 1.11 got me to stop ignoring Go

#20

> I have major gripes with PEP-8, and if you ever see me using it I want you to shoot me in the face. That sounds extreme. I've never heard this before. Why?

PEP-8, to quote it [1], says in its first sentence:

> This document gives coding conventions for the Python code comprising the standard library in the main Python distribution.

If you are not writing Python's stdlib, you are free to not to stick to it.

If in doubt, the next section of the document is helpfully titled "A Foolish Consistency is the Hobgoblin of Little Minds".

[1]: https://www.python.org/dev/peps/pep-0008/

Post reply on HN