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 iterate over a slice in reverse order
- How to use range
- How to get length of map
- How to URL decode value
- Find the nameserver records of a domain name
- How to sleep for 1 hour
- How to sleep for 500 milliseconds
- How to do case-insensitive regexp
- How to generate UUID and convert it to string
- How to get environment variable
See more codes...