golangUsing AND 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
false
More of Golang
- How to sleep for 500 milliseconds
- Marshal example
- How to iterate over a slice in reverse order
- How to use range
- How to generate random int
- How to write log to file
- How to sleep for 1 hour
- Find the nameserver records of a domain name
- How to URL decode value
- How to delete item from slice
See more codes...