运营商运算符将操作数组合成表达式。比较在别处讨论。对于其他二元运算符,除非操作涉及移位或无类型常量,否则操作数类型必须相同。对于仅涉及常量的操作,请参阅常量表达式部分。除移位操作外,如果一个操作数是无类型常量而另一个操作数不是,则将常量转换为另一个操作数的类型。例如,使用“ *”(乘法)运算符,package mainimport ( "time")func main() { // works - 1000 is an untyped constant // which is converted to type time.Duration time.Sleep(1000 * time.Millisecond) // fails - v is a variable of type int // which is not identical to type time.Duration var v = 1000 // invalid operation: i * time.Millisecond (mismatched types int and time.Duration) time.Sleep(v * time.Millisecond)}