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
- How to make POST (form data) request using HTTP client
- How to sleep for 500 milliseconds
- How to use proxy with HTTP client
- How to do case-insensitive regexp
- How to sleep for 1 hour
- How to use range
- How to sleep for 1 minute
- How to print new line with printf()
- How to generate random int
See more codes...