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
- Marshal example
- Find the nameserver records of a domain name
- How to iterate over a slice in reverse order
- How to sleep for 500 milliseconds
- How to sleep for 5 seconds
- Unrmarshal example
- How to do regex replace
- How to use proxy with HTTP client
- How to make POST (form data) request using HTTP client
- How to set user agent for HTTP request
See more codes...