Skip to content

Commit cf5360d

Browse files
author
xinwendashibaike
committed
修改表达不通顺的语句
1 parent 07d844c commit cf5360d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

zh/02.7.md

+2
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ channel通过操作符`<-`来接收和发送数据
110110
fmt.Println(<-c)
111111
fmt.Println(<-c)
112112
}
113+
//修改为1报如下的错误:
114+
//fatal error: all goroutines are asleep - deadlock!
113115

114116
## Range和Close
115117
上面这个例子中,我们需要读取两次c,这样不是很方便,Go考虑到了这一点,所以也可以通过range,像操作slice或者map一样操作缓存类型的channel,请看下面的例子

zh/05.1.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# 5.1 database/sql接口
2-
Go与PHP不同的地方是Go没有官方提供数据库驱动,而是为开发者开发数据库驱动定义了一些标准接口,开发者可以根据定义的接口来开发相应的数据库驱动,这样做有一个好处,只要按照标准接口开发的代码, 以后需要迁移数据库时,不需要任何修改。那么Go都定义了哪些标准接口呢?让我们来详细的分析一下
2+
Go与PHP不同的地方是Go官方没有提供数据库驱动,而是为开发数据库驱动定义了一些标准接口,开发者可以根据定义的接口来开发相应的数据库驱动,这样做有一个好处,只要是按照标准接口开发的代码, 以后需要迁移数据库时,不需要任何修改。那么Go都定义了哪些标准接口呢?让我们来详细的分析一下
33

44
## sql.Register
55
这个存在于database/sql的函数是用来注册数据库驱动的,当第三方开发者开发数据库驱动时,都会实现init函数,在init里面会调用这个`Register(name string, driver driver.Driver)`完成本驱动的注册。

0 commit comments

Comments
 (0)