@velartrill it's a map where the value is the empty struct which requires zero bytes storage. commonly used to have a table to look up which values exist.

@bonifartius > requires zero bytes storage

i guess in theory, do we actually know the go compilers optimizes that hack correctly tho?
Follow

@velartrill afaik as struct{} is by definition always the same it's optimized away

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.