Y
Hacker News
new
|
ask
|
show
|
jobs
by
xal
4434 days ago
I tend to use map[string]interface{} when I need a set. It works okay.
2 comments
farslan
4434 days ago
struct{} is better because it doesn't do an allocating. See:
https://github.com/fatih/set/blob/master/set_ts.go#L18
link
cespare
4434 days ago
Why interface{}? You're storing a value (and using space for it) that you don't need.
link