Go language operators
Translation results:
The Go language is designed as a systems programming language for use on giant central servers that power web servers, storage clusters, or similar purposes.
For the field of high-performance distributed systems, the Go language undoubtedly has higher development efficiency than most other languages. It provides massive parallel support, which is perfect for game server development.
Go language operatorssyntax
The built-in operators in the Go language are:
Arithmetic operators
Relational operators
Logical operators
Bitwise operations operator
Assignment operator
Other operators
Go language operatorsexample
package main import "fmt" func main() { var a int = 21 var b int = 10 var c int c = a + b fmt.Printf("The first line - the value of c is %d\n", c ) c = a - b fmt.Printf("The second line - the value of c is %d\n", c ) c = a * b fmt.Printf("The third line - the value of c is %d\n", c ) c = a / b fmt.Printf("The fourth line - the value of c is %d\n", c ) c = a % b fmt.Printf("The fifth line - the value of c is %d\n", c ) a++ fmt.Printf("The sixth line - the value of a is %d\n", a ) a=21 // For the convenience of testing, a is reassigned here to 21 a-- fmt.Printf("Seventh line - the value of a is %d\n", a )}