Skip to content

Commit

Permalink
Merge pull request #67 from tsingbx/boolean
Browse files Browse the repository at this point in the history
add doc for boolean
  • Loading branch information
xushiwei authored Dec 14, 2023
2 parents 1febec6 + 24d988a commit 452a705
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
7 changes: 7 additions & 0 deletions 110-Booleans/boolean-1.gop
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// The bool type represents Boolean variables. Variables of bool type can have
// one of two values: true or false. The zero value for a bool is false.

var flag bool // no value assigned, set to false
var isAwesome = true

println(flag, isAwesome)
5 changes: 5 additions & 0 deletions 110-Booleans/boolean-2.gop
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// In go+, you can cast bool to number types.

println int(true) // 1
println float64(true) // 1
println complex64(true) // (1+0i)
1 change: 0 additions & 1 deletion 110-Booleans/boolean.gop

This file was deleted.

0 comments on commit 452a705

Please sign in to comment.