Open wolfogre opened 5 years ago
优质博客+1
作者有心了,果断收藏此文
有心作者+1
刚被人用这玩意儿侮辱了一番
好文+1
作者后面的 免死声明笑死我了
好文,感谢博主
真的会在工程里出现这种代码吗?
有被作者声明笑到,今天确实遇到第四个问题。
const (
QualityOK int32 = 200
QualityGood int32 = 201
QualityGreat int32 = 202
QualityLow = 400 + iota
QualityPoor
)
我期待着QualityPoor应该打印401,然而它打一架的是404。。。所以我真的到你这来了。。。
const (
mutexLocked = 1 << iota
mutexWoken
mutexStarving
mutexWaiterShift = iota
)
1 2 4 3
const (
mutexLocked = 1 << iota //iota =0
mutexWoken//iota=1
mutexStarving//iota=2
mutexWaiterShift = iota//iota=3
)
const (
mutexLocked = 1 << 0
mutexWoken = 1 << 1
mutexStarving = 1 << 2
mutexWaiterShift = 3
)
const (
mutexLocked = 1
mutexWoken = 2
mutexStarving = 4
mutexWaiterShift = 3
)
https://blog.wolfogre.com/posts/golang-iota/