Skip to content

Commit 14d53bd

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents 1e82dd6 + b9004dd commit 14d53bd

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

src/deb.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
| 名称 | 描述 | 仓库 |
2929
| --------- | ------------------- | ------------------------------------------------ |
30-
| grom | 开发者友好的 ORM 库 | https://github.com/go-gorm/gorm |
30+
| gorm | 开发者友好的 ORM 库 | https://github.com/go-gorm/gorm |
3131
| xorm | 简单强大的 ORM | https://gitea.com/xorm/xorm |
3232
| ent | FaceBook 开源的 ORM | https://github.com/ent/ent |
3333
| sqlx | 对 sql 库的强大拓展 | https://github.com/jmoiron/sqlx |
@@ -287,7 +287,7 @@
287287
| ---------- | ------------------------------------- | ------------------------------------------------ |
288288
| fyne | 跨平台的 GUI 开发工具箱(真有点东西) | https://github.com/fyne-io/fyne |
289289
| go-flutter | 用 go 写 flutter | https://github.com/go-flutter-desktop/go-flutter |
290-
| | | |
290+
| Wails | 可以将它看作为 Go 的快并且轻量的 Electron 替代品 | https://github.com/wailsapp/wails |
291291

292292
### 系统交互
293293

src/essential/impl/err/3.nil.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
type A struct {
99
b B
1010
c C
11-
d D
11+
d D
1212
}
1313

1414
func (a A) Close() error {
@@ -197,14 +197,18 @@ func main() {
197197
}
198198
```
199199

200-
当 map 为`nil`的时候,还可以对其进行访问
200+
当 map 为`nil`的时候,还可以对其进行访问,但`nil`的 map 是只读的,一旦尝试写入就会引发panic
201201

202202
```go
203203
func main() {
204204
var s map[string]int
205205
i, ok := s[""]
206206
fmt.Println(i, ok)
207207
fmt.Println(len(s))
208+
209+
// 尝试写入时,会引发panic
210+
s["a"] = 1 // panic: assignment to entry in nil map
211+
208212
}
209213
```
210214

src/essential/senior/105.reflect.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,9 @@ const (
182182
)
183183
```
184184

185-
`Kind`类型仅仅实现了`Stringer`接口的`String()`方法,该类型也仅有这一个方法,`String()`方法的返回值来自于一个其内部的`map`,如下所示
185+
`Kind`类型仅仅实现了`Stringer`接口的`String()`方法,该类型也仅有这一个方法,`String()`方法的返回值来自于一个其内部的
186+
`slice`,如下所示,这种写法乍一看很像 map,但其实这是 Go 中的一种特殊的写法:索引初始化语法(index expressions in slice
187+
literals)
186188

187189
```go
188190
var kindNames = []string{

0 commit comments

Comments
 (0)