Given a struct:
type Foo struct {
Bar int
}
option 1, Map's key: struct value
map[Foo]bool
option 2, Map's key: pointer to struct
map[*Foo]bool
Would there be situations that I must pick option 2? I.e:
- memory efficiency?
- huge struct value?
In general, what are the use-cases where its plausible of having map's key as pointer to struct
?