Category: Expressions

Go Language Expressions

Expressions
Mostly C-like operators.
Binary operators:

Prec

operators

comments

6

* / % << >> & &^

&^ is “bit clear”

5

+ – | ^

^ is “xor”

4

== != < <= > >=

3

<-

communication

2

&&

1

||

Operators that are also unary: & ! * + – ^ <-
Unary ^ is complement.

Go vs. C expressions
Surprises for the C programmer:

fewer precedence levels (should be easy)
^ instead of ~ (it’s [...]