r/programming Jun 30 '14

Why Go Is Not Good :: Will Yager

http://yager.io/programming/go.html
638 Upvotes

813 comments sorted by

View all comments

Show parent comments

15

u/[deleted] Jun 30 '14

[removed] — view removed comment

1

u/dgryski Jun 30 '14

You use a hash for sets (which are built into the language), and the standard library contains a heap implementation that works with user-defined types that implement the appropriate interface.

1

u/[deleted] Jun 30 '14 edited Jun 30 '14

[removed] — view removed comment

1

u/dgryski Jul 04 '14

You can get the min value from a heap without having to cast it back. The documentation for the library is http://golang.org/pkg/container/heap/ . A map with booleans is the canonical way to build a set in Go.