by golergka · 10y ago · 0 comments
No way to specify a version of library or language I'm working with is already a little bit annoying, although I haven't actually discovered problems because of it. But the $GOPATH just drives me nuts: why the hell would the language infrastructure work out of assumption that all my projects that are based on a single language are contained in a single folder? On the contrary, I often have projects that include several different languages and frameworks in them, and I'm usually keeping client and server in the same repo. Language is a part of a project, not the other way around. I ended up with this hackery in my server Makefile:
build:
GOPATH=$(shell pwd) go install main
Overall, just as Go itself is transparent and simple, it's `import` statement and build infrastructure is not. "Convention over configuration" may be a good approach for simple web apps, but when this convention just doesn't fit your workflow, it brings more bad than good.[edit]
Interfaces are hardly new. Go's novel take is the 'auto-morphism'[1] of types that (happen) to implement the function set aggregated in an interface. And this approach has its strengths and its weaknesses.
[1]: ok, I made that up.