来自 A Tour of Go :
An array has a fixed size. A slice, on the other hand, is a dynamically-sized, flexible view into the elements of an array.
当 slice 不能超出底层数组的大小时,如何将 slice 称为动态大小。
最佳答案
Go 数组的大小在编译时是固定的。 Go slice 的大小在运行时动态设置。
引用:
The Go Blog: Go Slices: usage and internals
The Go Blog: Arrays, slices (and strings): The mechanics of 'append'
关于arrays - 当 slice 的最大长度小于底层数组的长度时, slice 的术语 “dynamically sized” 如何合理?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59235575/