Go: Support for Generic Methods
149 points - today at 9:02 AM
SourceComments
xena today at 5:26 PM
This will finally let me make the monad library I've been dreaming of for years. Be afraid.
nasretdinov today at 1:22 PM
Lack of generic methods was really surprising to me when I was first trying to use generics in Go. Nice to see it being actually implemented
kardianos today at 1:08 PM
This is great. Will be useful for data access methods!
As for the detractors, from the first generics proposal this was called out as a "not now", not never. There were questions of implementation. They aren't a super large team, and they try to do things incrementally and do them well.
h1fra today at 12:36 PM
slowly implementing all the things they said we didn't need
mackross today at 3:26 PM
What a happy surprise today! The amount of times I’ve had to do weird janky package APIs so the API was still reasonable is more than I can count.
reactordev today at 1:35 PM
This resolves a big gap in generics for most people coming from other languages to go so I completely approve this direction. Not saying use it everywhere but if you must use it, it’s better to have it on the struct than call a module level generic func.
samber today at 2:18 PM
OMG. I'm going to recode some of my libraries.
binary132 today at 1:48 PM
Chasing a perceived gap between language features and user expectations has been and continues to be the greatest error in the leadership of Go.
throwpikerob today at 2:07 PM
A sad day for Go, the pHDs have won, simplicity has died.