ksimka / go-is-not-good

A curated list of articles complaining that go (golang) isn't good enough
3.82k stars 129 forks source link

Missing entry: No math.abs methods for anything that is not float #34

Closed lital-lb closed 6 years ago

lital-lb commented 6 years ago

No article, had to go to IRC to ask about it.

Here's the stdlib implementation where only the float version exist. Happy casting https://golang.org/src/math/abs.go

Solution? Implement the appropriate abs methods yourself Why? "Go creators work in mysterious ways" - someone told to me on the IRC channel

dgryski commented 6 years ago

This and the sorting issue probably fall under no generics.

ksimka commented 6 years ago

No article

But you can write your own and make a PR.