docs: Boolean 布尔

This commit is contained in:
Shikong 2021-09-12 20:34:47 +08:00
parent eb1ba1af27
commit 9262520ce6

13
base/boolean/main.go Normal file
View File

@ -0,0 +1,13 @@
package main
import "fmt"
func main() {
// 在 golang 中 不允许 从其他类型 强制转换 到 bool 类型
b1 := true
// bool 默认为 false
var b2 bool
// %T 打印变量类型
fmt.Printf("b1: %T %t\nb2: %T %t\n", b1, b1, b2, b2)
}