Generic Programming in Go
Too Long; Didn't Read
Generic Functions were added in Go in the 1.18 release of the language. These are functions defined with Type parameters, intended to be resolved with type information. The compiler uses these types to instantiate suitable versions, resolving any function overloading. The Map function takes a slice and a callback function that modifies each item and writes the item in a new slice `mapped` The function implementation looks similar to the integer mapping implementation for integer values. In practice, it gives the following features: code writing becomes comfortable for developers since there is no need to implement or generate code for every new data type.