Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
mseepgood
48 days ago
|
parent
|
context
|
favorite
| on:
Go 1.27 Interactive Tour
It's not good Go code anyway. In Go you would use a for loop. Just because Go has generics nowadays doesn't mean you should abandon good taste and write ML/Haskell/Rust/C# in it.
wannabe44
48 days ago
[–]
Sure it's a bad example. But you can't simplify something like this without losing type safety:
SortBy[T, K comparable](slice: []T, key: func (T) K)
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: