3 ms·
I tend to use map[string]interface{} when I need a set. It works okay.
I tend to use map[string]interface{} when I need a set. It works okay.
Why interface{}? You're storing a value (and using space for it) that you don't need.
struct{} is better because it doesn't do an allocating. See: https://github.com/fatih/set/blob/master/set_ts.go#L18 https://github.com/fatih/set/blob/master/set_ts.go#L18