Advertisement
cwchen

[Go] Comparison operators

Sep 9th, 2017
491
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.25 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.     "fmt"
  5. )
  6.  
  7. func main() {
  8.     a := 5
  9.     b := 3
  10.  
  11.     fmt.Println(a == b) // false
  12.     fmt.Println(a != b) // true
  13.     fmt.Println(a > b)  // true
  14.     fmt.Println(a >= b) // true
  15.     fmt.Println(a < b)  // false
  16.     fmt.Println(a <= b) // false
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement