Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 48b9f0a

Browse files
authored
预定义函数
1 parent 5b7e281 commit 48b9f0a

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

go/note.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,16 @@ func (c Circle) getArea() float64 { //重点:这里相当于把getArea()方
206206
}
207207
```
208208

209+
## 预定义函数
210+
- len 和cap 可用于不同的类型,len 用于返回字符串、slice 和数组的长度。参阅”array、slices和map”。
211+
- new 用于各种类型的内存分配。参阅”用new 分配内存”。
212+
- make 用于内建类型(map、slice 和channel)的内存分配。参阅”用make 分配内存”。
213+
- copy 用于复制slice。append 用于追加slice。。
214+
- panic 和recover 用于异常处理机制。参阅”恐慌(Panic)和恢复(Recover)” 。
215+
- print 和println 是底层打印函数,可以在不引入fmt 包的情况下使用。它们主要用于调
216+
试。
217+
- complex、real和imag 全部用于处理复数。
218+
209219
## 六、数组
210220
1. 数组是具有相同唯一类型的一组已编号且长度固定的数据项序列.
211221

0 commit comments

Comments
 (0)