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 set user agent for HTTP request
- How to sleep for 1 second
- How to sleep for 5 seconds
- How to iterate over a slice in reverse order
- How to generate random int
- How to do case-insensitive regexp
- How to print new line with printf()
- How to sleep for 1 hour
- How to use proxy with HTTP client
- Marshal example
See more codes...