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

View File

@@ -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)

View File

@@ -12,7 +12,7 @@ type myList struct {
extendRatio int
}
/* 构造方法 */
/* 构造函数 */
func newMyList() *myList {
return &myList{
numsCapacity: 10, // 列表容量