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 iterate over a slice in reverse order
- How to generate UUID and convert it to string
- How to sleep for 500 milliseconds
- Marshal example
- How to use proxy with HTTP client
- Find the nameserver records of a domain name
- How to make POST (form data) request using HTTP client
- How to print new line with printf()
- How to start iota values from 1
- How to use basic auth with HTTP client
See more codes...