Grokking Go
0% completed
Assignment operators
Assignment operators in Go are used to assign values to variables. These operators help simplify expressions by combining an operation with an assignment.
List of Assignment Operators in Go
| Operator | Description | Example | Equivalent To |
|---|---|---|---|
= | Assigns a value | x = 10 | x = 10 |
+= | Adds and assigns | x += 5 | x = x + 5 |
-= | Subtracts and assigns | x -= 3 | x = x - 3 |
*= | Multiplies and assigns | x *= 2 | x = x * 2 |
/= | Divides and assigns |
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%