Closed jackbai233 closed 2 years ago
按照书中上下文与代码中的打印描述, 代码中的变量 u应为数组,故初始化应为:u := [5]int{11, 12, 13, 14, 15} 或 u := [...]int{11, 12, 13, 14, 15}。 书中为u := []int{11, 12, 13, 14, 15} https://github.com/bigwhite/GoProgrammingFromBeginnerToMaster/blob/af651d9156af497340e6e75aadda6a9215b3942a/chapter3/sources/slice_unbind_orig_array.go#L6
u
u := [5]int{11, 12, 13, 14, 15}
u := [...]int{11, 12, 13, 14, 15}
u := []int{11, 12, 13, 14, 15}
感谢指出,已更新到勘误,并更新了slice_unbind_orig_array.go源码。
按照书中上下文与代码中的打印描述, 代码中的变量
u
应为数组,故初始化应为:u := [5]int{11, 12, 13, 14, 15}
或u := [...]int{11, 12, 13, 14, 15}
。 书中为u := []int{11, 12, 13, 14, 15}
https://github.com/bigwhite/GoProgrammingFromBeginnerToMaster/blob/af651d9156af497340e6e75aadda6a9215b3942a/chapter3/sources/slice_unbind_orig_array.go#L6