Henry Chong

Go: Let's Go!

3D render of the Blue Gopher Golang mascot typing on a keyboard

📷: Bing Image Creator

I'm starting a new job in a few weeks time, and my new workplace uses Go (aka Golang). As an engineering manager, I don't expect to write large amounts of code since being good at my role means empowering others to do so. However, I do expect to learn enough Go to understand how things work, be able to weigh in on technical decisions if needed, and frankly it's been refreshing to learn something new outside of the Meta bubble.

For readers brand new to Go like myself, I'd highly recommend watching this fantastic talk on Go & Microservices. In one short and informative hour, it covers many of the unique language features, as well as why and how Go is used in a complex, real world use case.

As well as the video, I've been going through several resources to try and hit my learning goals. While I've barely scratched the surface, here's what I've found interesting about Go so far:

  • Functions can return multiple results. Sure, you can do the same in C# or Java by returning complex objects and then unpacking the contents (or other means), but it's interesting to see the clean and simple Go syntax that supports this natively.
  • Go allows some really interesting control flows. There's defer, which allows you to mentally backtrack and is handy for cleanup, as well as the related panic and recover. Then there's goroutines themselves which allow easy concurrency. These complex control flow possibilities are balanced out by what feels to be a simpler type system, although:
  • Imaginary numbers (i) are a core base type. I wonder what the usecase was. Is this for graphics? Fast Fourier Transforms? Let me know me on Threads if you know!

It took me an embarassingly long time to write my first Go function (as part of A Tour of Go), but there's plenty of learning materials out there and I'm looking forward to becoming an Effective Go engineer!