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

Skip to content

Commit 9c2e000

Browse files
committed
update golang method set
1 parent d8ac560 commit 9c2e000

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

source/basic/json.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,6 @@ if err := json.Unmarshal(data, &titles); err != nil {
104104
}
105105
fmt.Println(titles) // "[{Casablanca} {Cool Hand Luke} {Bullitt}]"
106106
```
107-
通过定义合适的Go语言数据结构,我们可以选择性地解码JSON中感兴趣的成员
107+
通过定义合适的 Go 语言数据结构,我们可以选择性地解码 JSON 中感兴趣的成员
108108

109109
基于流式的解码器 `json.Decoder`。针对输出流的 `json.Encoder` 编码对象

source/basic/map.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ for key, value := range mapName {
5454
```
5555
**`Map` 的迭代顺序是不确定的。可以先使用 `sort` 包排序**
5656

57+
#### map 为什么是无序的
58+
前面知道 map 遍历
5759
#### map 的键类型不能是哪些类型
5860
`map` 的键和元素的最大不同在于,前者的类型是受限的,而后者却可以是任意类型的。
5961

source/basic/oop.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,14 @@ Golang 方法集 :每个类型都有与之关联的方法集,这会影响到
117117
```
118118
• 类型 T 方法集包含全部 receiver T 方法。
119119
• 类型 *T 方法集包含全部 receiver T + *T 方法。
120+
120121
• 如类型 S 包含匿名字段 T,则 S 和 *S 方法集包含 T 方法。
121122
• 如类型 S 包含匿名字段 *T,则 S 和 *S 方法集包含 T + *T 方法。
122123
• 不管嵌入 T 或 *T,*S 方法集总是包含 T + *T 方法。
123124
```
124125

126+
**对于结构体嵌套匿名字段的类型是指针还是非指针**,根据实际情况决定。
127+
125128
## 嵌入结构体扩展类型
126129
```go
127130
import "image/color"

0 commit comments

Comments
 (0)