Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- /* Assignment */
- var isBool = true
- var isActive bool //is_active is set to false
- var isTrue = 1 <= 5 // as 1<=5 is true, isTrue variable is set to true
- /* Short circuiting */
- var res = 1 > 5 && 3 == 5 // First operands evaluates to false, so second is not evaluated
- var out = 2*2 == 4 || 10%3 == 0 // Second operand is not evaluated as first is true
- fmt.Println(isBool, isActive, isTrue, res, out)
- }
Add Comment
Please, Sign In to add comment