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 get response body of HTTP request
- How to sleep for 1 second
- How to set custom headers for HTTP request
- How to iterate over a slice in reverse order
- How to sleep for 5 seconds
- How to sleep for 1 hour
- How to get JSON data from HTTP request
- How to use proxy with HTTP client
- How to make POST (form data) request using HTTP client
- How to execute shell commands with exec()
See more codes...