Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Cool, I didn't know that. will change my Set implementation :)

BTW You should remember that if you really want a python-like set, map[interface{}]struct{} is not enough - you still have to implement intersection, union, diff yourself. Not that it's rocket science, but I do think this warrants at least a package in the std library, if not a first class type.



Agreed. There is an awesome project that provides this: https://github.com/deckarep/golang-set




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: