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 generate random string
- How to generate random int
- How to iterate over a slice in reverse order
- Marshal example
- How to print new line with printf()
- Unrmarshal example
- How to sleep for 1 second
- How to sleep for 5 seconds
- How to do case-insensitive regexp
- Formatting strings with Sprintf() example
See more codes...