Rantings from a guy with way too much free time

Once Upon a Reflection: Looking Deeper into Golang reflection

2017-12-04 7 minute read golang programming Rob Baruch
I often reflect upon my code… One of the coolest features of the Golang programming language is the reflect package. As the package documentation states at the onset of the package: Package reflect implements run-time reflection, allowing a program to manipulate objects with arbitrary types. The typical use is to take a value with static type interface{} and extract its dynamic type information by calling TypeOf, which returns a Type. Continue reading

Wanna learn you some Go? Tutor up over here!


Go Get Interfaced: Enums in Golang

2017-12-02 3 minute read programming golang Rob Baruch
Golang, Interfaces, and Enums So here’s a nice golang idiom that I ran across years ago that I found generally useful. Golang, unlike languages like c doesn’t natively support enumerations. Instead, constants typically are used when creating a list of enumerations. But, go is a strongly-typed language, so we can do better than simply using constants - we can type our enumeration with the use of a type declaration. Continue reading


2017-11-29 4 minute read golang programming Rob Baruch
Here we gogo! Years ago, I wrote an interesting article that I thought might be worth re-posting (and revising) here on my blog. For a while I got into programming in golang and in the early going (pun-alert!), there were a lot of idioms that were not well understood by a noob. One of those paradigms was channels, go-routines, and signals used simultaneously. Taken separately, they are more easily understood. Continue reading