Hacker News new | ask | show | jobs
by sdevonoes 1592 days ago
I would add: an extended standard library for "common stuff". I don't want to import a third-party library nor write my own "utils.go" to do:

    func contains(s []int, e int) bool {
        for _, a := range s {
            if a == e {
                return true
            }
        }
        return false
    }
2 comments

If you need to look up or worse, delete, a value in a slice, then you probably shouldn't be using a slice in the first place. You probably want to replace your slice with a set.