golangUsing AND 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
false
More of Golang
- How to sleep for 1 second
- How to make POST (form data) request using HTTP client
- How to get response body of HTTP request
- How to get JSON data from HTTP request
- How to set custom headers for HTTP request
- How to execute shell commands with exec()
- How to convert struct to JSON
- How to use basic auth with HTTP client
- How to convert map to struct
- How to print new line with printf()
See more codes...