数组

Go 数组#

什么时候使用数组,而不是切片?#

  • arrays are hashable. That means they can be used as a key to a map
  • can be serialized by encoding/binary
  • pass by value. planning the detailed layout of memory

参考: