Empty Structs

Empty structsarrow-up-right are used in Go as a unaryarrow-up-right value.

example.go
// anonymous empty struct type
empty := struct{}{}

// named empty struct type
type emptyStruct struct{}
empty := emptyStruct{}
circle-info

The cool thing about empty structs is that they're the smallest possible type in Go: they take up zero bytes of memory.

![[{3CAA450A-3C64-43B1-9E95-102C9B6AF545}.png]]