Go Errors Part 1

… it is clear that these Go programmers miss a fundamental point about errors: Errors are values. - Rob Pike This takes a while to get use to when moving to Go but if you get anything out of what I am about to write, it would be that quote. Let me go into more detail. Errors are values and is an interface. // builtin/builtin.go L252 // The error built-in interface type is the conventional interface for // representing an error condition, with the nil value representing no error.…

read more »

Middleware and HTTPRouter

Updated 12/2/2016 - I have added an example of how to achieve this with Go 1.7’s context/context package. I really love HTTPRouter over using other frameworks but there was a problem. It doesn’t meet “net/http” Handler interface because it adds the params to function. That is fine except when you need to attach other middleware to your application which I guarantee that you will have to. For reference, this is what I am referring to.…

read more »

better go coding habits

So I just got done evaluating a bunch of golang-challenge submissions. It was a blast reading and seeing everyone’s solutions but I am going echo what Jeff Allen said. Go is definitely not free of WTF moments. I don’t know what people code in. If you want me to mock you, tell me you work in an IDE like IntelliJ. Vim is the best for coding Go in my opinion. Unless you are like Dominik who loves his emacs which is acceptable.…

read more »

moving to go

I am not Tj Holowaychuk. I don’t write a million libraries a year and I won’t knock Node.js. Node is a very amazing to work with and I still plan on using it for all my front-end projects. Its also amazing for writing quick services that need to get out the door quickly. So why did I switch? I work in operations as a developer. I am C programmer at my roots but I work in web technologies.…

read more »