I have an if statement in Go that looks like this:
if level & 1 {
// do something
} else {
// do something else
}
The variable levelin my reason is of type uint. But when I beat AND with 1, the result is not logical. This is a valid syntax for C, but apparently it does not work in Go. Any idea how to get around this?
source
share