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 generate random float
- How to generate random int
- How to iterate over a slice in reverse order
- How to generate random string
- How to set custom headers for HTTP request
- How to check Go version
- How to use basic auth with HTTP client
- Unrmarshal example
- How to use range with string
- How to set user agent for HTTP request
See more codes...