Live data from Hacker News

Stages of learning Go, with code examples

sourcegraph.com

11–20 of 118 posts

Re: Stages of learning Go, with code examples

#12
post #2

It's a tool, not a religion. Don't try to turn it into a cult.

And like all tools, use where it makes sense. I think that is Go's one of the strength, it's friendly to Polyglot setup.

I gave talk that conveys similar sentiment. Slide: https://speakerdeck.com/nexneo/joy-of-single-purpose-service...

Re: Stages of learning Go, with code examples

#14
post #5

Just wondering, does Go finally has a package manager with proper versioning of modules? Edit: Somebody is heavily downvoting me on every reply, I would love to know why. I like Go and want to get into it since a few months but the missing package manager held me off. So what is wrong about my question?

We prefer to use version control, and vendor libraries in our project instead. This is language-agnostic, and allows us to have repeatable builds without extra tools.

I've written up a tutorial about it using git-subtree:

https://github.com/jamesgraves/example-go-app

Re: Stages of learning Go, with code examples

#15

> Phase 4 (the expert): You understand the design choices and motivations behind the language. You grok the philosophy of simplicity and composability. In what way is Go code composable?

There's long articles and talks about the topic. Check this one: https://vimeo.com/53221560

Re: Stages of learning Go, with code examples

#16
post #9
post #8

Earlier quoted context omitted.

All Go packages can be found on godoc.org Installed with "go get" And if you want to vendor the dependencies use godep.

Thanks. And how can I define the version of the module which should be imported?

You can't. You are expected to vendor for dependable builds. This has upsides and downsides.

It does completely sidestep version dependencies hell and encourages you to think carefully about which dependencies you package. It does that by making you manually responsible for keeping dependencies up to date if you distribute other people's code with your own.

So, in answer to your original question, no go doesn't finally have a package manager with proper versioning (at least no official one). In practice, this is not as big an issue as you might think if you come from a language with such a package manager. In practice, I haven't really found it as much of a burden as I thought I might.

Re: Stages of learning Go, with code examples

#17

> Phase 4 (the expert): You understand the design choices and motivations behind the language. You grok the philosophy of simplicity and composability. In what way is Go code composable?

You probably were sarcastic, but in case you are not there's a brilliant article from Rob Pike about using and composing functions to create flexible APIs: http://commandcenter.blogspot.co.uk/2014/01/self-referential...

There is countless proof about Go's composability through functions and interface, but I keep coming back to that one document.

Re: Stages of learning Go, with code examples

#20
post #9
post #8

Earlier quoted context omitted.

All Go packages can be found on godoc.org Installed with "go get" And if you want to vendor the dependencies use godep.

Thanks. And how can I define the version of the module which should be imported?

You can try nut : https://github.com/jingweno/nut
Post reply on HN