|
|
|
|
|
by Insanity
2622 days ago
|
|
Well the code is the same for all of them (but when using a bool map we assign true instead of empty struct). So we run this code inside a benchmarking function: m := map[int]interface{}
// or m := map[int]struct{}
for i := 0; i < t.N; i++ {
m[i] = struct{}{}
}
edit: fix code. |
|
https://play.golang.org/p/5acy87JLD3i