golangUsing OR 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
true
More of Golang
- How to use proxy with HTTP client
- How to set user agent for HTTP request
- How to sleep for 1 minute
- How to use capture regexp
- Find the nameserver records of a domain name
- Formatting strings with Sprintf() example
- How to get environment variable
- How to use ENUM type
- How to generate UUID and convert it to string
- How to iterate over a slice in reverse order
See more codes...