Skip to content

Commit 452a705

Browse files
authored
Merge pull request #67 from tsingbx/boolean
add doc for boolean
2 parents 1febec6 + 24d988a commit 452a705

3 files changed

Lines changed: 12 additions & 1 deletion

File tree

110-Booleans/boolean-1.gop

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// The bool type represents Boolean variables. Variables of bool type can have
2+
// one of two values: true or false. The zero value for a bool is false.
3+
4+
var flag bool // no value assigned, set to false
5+
var isAwesome = true
6+
7+
println(flag, isAwesome)

110-Booleans/boolean-2.gop

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// In go+, you can cast bool to number types.
2+
3+
println int(true) // 1
4+
println float64(true) // 1
5+
println complex64(true) // (1+0i)

110-Booleans/boolean.gop

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)