A Heap of Go Generics

nwillc
Level Up Coding
Published in
2 min readApr 23, 2021

--

I come from languages with generics, additionally, I have issues with the amount of boilerplate code I write in Go. So, I’ve been looking forward to Go generics with hope. I’ve had specific types of generics use cases in mind, and when I found I could play with Go’s generics at The Go2 Go Playground. I decided to see if I could solve one. For those wanting the TLDR answer: yes!

My Use Case

--

--

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.