Go语言中的运算符均是从左至右结合
Go语言内置的运算符有:
- 算术运算符
- 关系运算符
- 逻辑运算符
- 位运算符
- 赋值运算符
- 其他运算符
算术运算符
下表列出了所有Go语言的算术运算符。假定A值为10, B值为20。

关系运算符
下表列出了所有Go语言的关系运算符。假定A值为10,B值为20。

不同类型的数据不能直接比较。各种类型的整型变量都可以直接与字面常量进行比较。
逻辑运算符
下表列出了所有Go语言的逻辑运算符。假定A值为True,B值为False。

位运算符
位运算符对整数在内存中的二进制位进行操作。下表列出了位运算符&,|,^的计算:

Go语言支持的位运算如下表所示。假定A为60,B为13。

赋值运算符
下表列出了所有Go语言的赋值运算符。

其他运算符
下表列出了Go语言的其他运算符。

运算符优先级
有些运算符拥有较高的优先级,二元运算符的运算方向均是从左至右。下表列出了所有运算符以及它们的优先级,由上至下代表优先级由高到低:

当然,也可以通过使用括号来临时提升某个表达式的整体运算符优先级。