Fix "函数" and "方法"

This commit is contained in:
krahets
2023-06-24 16:37:56 +08:00
parent 674ff2910a
commit 504dff1728
10 changed files with 18 additions and 18 deletions
@@ -21,7 +21,7 @@ func TestArray(t *testing.T) {
fmt.Println("数组 arr =", arr)
// 在 Go 中,指定长度时([5]int)为数组,不指定长度时([]int)为切片
// 由于 Go 的数组被设计为在编译期确定长度,因此只能使用常量来指定长度
// 为了方便实现扩容 extend() 方法,以下将切片(Slice)看作数组(Array)
// 为了方便实现扩容 extend() 函数,以下将切片(Slice)看作数组(Array)
nums := []int{1, 3, 2, 5, 4}
fmt.Println("数组 nums =", nums)
@@ -12,7 +12,7 @@ type myList struct {
extendRatio int
}
/* 构造方法 */
/* 构造函数 */
func newMyList() *myList {
return &myList{
numsCapacity: 10, // 列表容量