loading...
Go map的key
Published in:2024-09-26 |

boolean, numeric, string, pointer, channel, interface 均可作为key

其中 interface 的相等判定是动态类型和动态值都要相等

然后 structs 和 arrays 如果只含有上面这些类型的元素, 那么也可以作为key

slices, maps, functions 不可以作为key

Prev:
Go time.Tick 和 time.After 内存泄露
Next:
Go init之坑
catalog
catalog