«

y u no framework

This is the most common question that I receive about building web applications in Go is: “What framework should I use to build my API?” To really explain this to you, it has to do with experience, problems running Go in production and lastly, a little history lesson. Why the history lesson? What does that have to do with frameworks? If we don’t learn our history, we are doomed to repeat it.…

read more »

simplicity in go

I have been coding in Go for a while but I keep reading about it’s problems because as Gophers, we can take criticism. The common thing is that the language is too simple and use Rob Pike’s quote to emphasize that. This in turn is totally misusing the quote. So I have found a few things that I ask myself everytime that I write some code. Is my solution in the simple and elegant form?…

read more »

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 »