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 5 seconds
- How to print new line with printf()
- How to iterate over a slice in reverse order
- How to set cookie for HTTP request
- Marshal example
- How to generate random float
- How to generate random int
- Unrmarshal example
- How to URL decode value
- How to return value from goroutine using channels
See more codes...