paint-brush
Generic Programming in Goby@vgukasov
3,644 reads
3,644 reads

Generic Programming in Go

by Vladislav GukasovJune 2nd, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

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.
featured image - Generic Programming in Go
Vladislav Gukasov HackerNoon profile picture
Vladislav Gukasov

Vladislav Gukasov

@vgukasov

L O A D I N G
. . . comments & more!

About Author

Vladislav Gukasov HackerNoon profile picture
Vladislav Gukasov@vgukasov

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Platypush
Coffee-web
Artist