Skip to content

Commit b012bf3

Browse files
committed
1 parent 12dd71e commit b012bf3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ebook/02.2.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,10 @@ Go里面有一个关键字`iota`,这个关键字用来声明`enum`的时候采
236236
)
237237

238238
const v = iota // 每遇到一个const关键字,iota就会重置,此时v == 0
239+
240+
const (
241+
e, f, g = iota, iota, iota //e=0,f=0,g=0 iota在同一行值相同
242+
)
239243

240244
### Go程序设计的一些规则
241245
Go之所以会那么简洁,是因为它有一些默认的行为:

0 commit comments

Comments
 (0)