Sign inSign up

akutz/go-generics-the-hard-way

By akutz

•Updated over 4 years ago

A hands-on approach to getting started with Go generics.

Image
0

1.4K

akutz/go-generics-the-hard-way repository overview

⁠Go generics the hard way

I started using Go back around 2015 and was immediately surprised by the lack of a generic type system. Sure, the empty interface{} existed, but that was hardly the same. At first I thought I wanted needed generics in Go, but over time I began appreciating the simplicity of the language. Therefore I was ambivalent at best when I learned of discussions to introduce generics in Go 2.0, and once the timetable was accelerated to 1.18, I decided it was time to dig into the proposal.

After a while, I gained an appreciation for how generics are implemented with the same elegance as Golang itself, and this moved me to share my experience. Go generics the hard way is a culmination of the time I spent playing with this new feature and provides a hands-on approach to learning all about generics in Go.

⁠Image

This image is for running the examples out of the Go generics the hard way⁠ repository. Please refer to the GitHub link for additional information.

Tag summary

Content type

Image

Digest

Size

1.1 GB

Last updated

over 4 years ago

docker pull akutz/go-generics-the-hard-way