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
- How to generate random int
- How to iterate over a slice in reverse order
- How to do case-insensitive regexp
- How to use range
- How to sleep for 5 seconds
- How to log errors
- Find the nameserver records of a domain name
- How to write log to file
- How to make POST (form data) request using HTTP client
See more codes...