A Couple of Interesting Go Syntax Nuances

nwillc
1 min readJun 14, 2022

I’m a bit jaded with regards to programming languages, so I enjoy finding interesting nuances in them. Here a couple from Go.

Assignments, Arguments & More

If you’ve written any Go you’ll know you can assign multiple return results in one statement:

And maybe you know that commas can appear on the right side of the assignment too, so in fact, the rotate function is redundant:

But you might not know this one, I only stumbled on it recently:

--

--

nwillc

Graybeard code monkey, started on an Apple IIe, got a CS degree in the 80’s, and coded my way through C, C++, Objective-C, Java, Kotlin — and now Go.