Go is a blast!

Post by Saul Shanabrook

I finally managed to start writing some Go code today, which was much easier than I thought it would be.

The first lines of my project are tested and available on Github.

I will go through the tools and resources I used, in the hopes that if you are also starting you might have to do a bit less of the googling I did already.


Like everyone else out there, I reccomend using the Go Tour. I read through it before starting to code and I also reffered back to it frequently.

Also there are many good blogs posts on the Go blog which I found through Google searches, for instance on slices vs arrays.



Although Go has built in testing support, it doesn't provide assertions and many testing tools that I have come to expect from a testing framework. I felt I would be more productive if I didn't have to type a bunch of if statements that called test.Error. After looking through many of the testing frameworks for Go, I settled on GoConvey. I liked how when you write tests, you also document what you are testing for, so it is easy to know what is breaking when your tests don't pass.

func TestStateStack(t *testing.T) {

    Convey("Given no states", t, func() {

        Convey("It should return an empty state", func() {
            dimmers, err := StateStack{[]State{}}.DimmersAt()
            So(dimmers, ShouldResemble, DimmerMap{})


They also have a great web UI.

I reccomend watching their quick intro video (Available in 2160p!) for some good tips.


To get inline type checking and all those goodies, I settled on using the go-plus extension for the Atom editor. Normally I used Sublime Text, but found GoSublime more confusing and less well developed. I didn't do any extensive testing though, so take that with a (large) grain of salt.

It looks like the best supported editor extensions in vim-go, so if you are into command line text editors, I would give that a go.