golangUsing OR operator
package main
import (
"fmt"
)
func main() {
X := true
Y := false
xor := X || Y
}ctrl + c||logical |
Usage example
package main
import (
"fmt"
)
func main() {
X := true
Y := false
fmt.Println(X || Y)
}
output
true
More of Golang
- How to sleep for 500 milliseconds
- How to get length of map
- Marshal example
- How to sleep for 1 hour
- How to use range with string
- How to set user agent for HTTP request
- How to generate random int
- How to generate random float
- How to sleep for 1 second
- How to generate random string
See more codes...