suggest change

Value of type bool can be true or false.

Zero value of bool is false.

var b bool = true
fmt.Printf("b is: '%v'\n", b)
b = false
fmt.Printf("b is: '%v'\n", b)
var b2 bool
fmt.Printf("zero value of bool is: '%v'\n", b2)
b is: 'true'
b is: 'false'
zero value of bool is: 'false'

Size of bool variable (e.g. when part of a struct) is 1 byte.

b := true
fmt.Printf("size of bool is: %d\n", unsafe.Sizeof(b))
size of bool is: 1

Feedback about page:

Optional: your email if you want me to get back to you:

Table Of Contents