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 1 hour
- How to sleep for 5 seconds
- How to declare and use constant
- Marshal example
- How to sleep for 500 milliseconds
- How to generate random int
- HTTP client example
- How to sleep for 1 second
- How to make POST (form data) request using HTTP client
- How to generate random float
See more codes...