Writing type parametric functions in Go

from blog Andrew Gallant's Blog on Andrew Gallant's Blog, | ↗ original
Go’s only method of compile time safe polymorphism is structural subtyping, and this article will do nothing to change that. Instead, I’m going to present a package ty with facilities to write type parametric functions in Go that maintain run time type safety, while also being convenient for the caller to use.