top | item 46335776

(no title)

tym0 | 2 months ago

Using a bool instead of empty struct also means that there is more way to use it wrong: check the bool instead of if the key exist, set the bool incorrectly, etc...

I would argue using bool hurts readability more.

Even better write/use a simple library that calls things that are sets `Set`.

discuss

order

Joker_vD|2 months ago

I could've sworn we got "sets" in the Go's standard library along with the "maps" module but... apparently not? Huh.

vips7L|2 months ago

Honestly insane in 2025 to not have a generic Set.