Guest User

Untitled

a guest
Jan 23rd, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. package main
  2.  
  3. import "fmt"
  4.  
  5. func main() {
  6. /* Assignment */
  7. var isBool = true
  8. var isActive bool //is_active is set to false
  9. var isTrue = 1 <= 5 // as 1<=5 is true, isTrue variable is set to true
  10.  
  11. /* Short circuiting */
  12. var res = 1 > 5 && 3 == 5 // First operands evaluates to false, so second is not evaluated
  13. var out = 2*2 == 4 || 10%3 == 0 // Second operand is not evaluated as first is true
  14.  
  15. fmt.Println(isBool, isActive, isTrue, res, out)
  16. }
Add Comment
Please, Sign In to add comment