Hacker News new | ask | show | jobs
by jniedrauer 1857 days ago
Using a map might not be faster as others have pointed out, but it's often more readable. The core library does this in several places. A map[someType]bool makes for nice, readable code:

    if haystack[needle] {
1 comments

The lack of an ordered map keep me using slices where I'd otherwise reach for a map. This is one of the things I'm looking forward to once generics are in Go.