News for hackers. Stuff that matters.
Re:PEP 584 – Add + and – operators to the built-in dict class by majewsky on Wednesday March 06, 2019 @01:11PM (#19321092)
map[T]struct{} is a type-safe set type. It's just not an ergonomic one.

FWIW, I'm usually using map[T]bool and only ever inserting `true` values. It uses a bit more space, but membership checks read like

  if set[key] {
instead of

  if _, ok := set[key]; ok {

There are no comments on this comment yet.