![]() |
| ||||||||||||||
Navigation |
Synopsis Assign a value to a variable or more complex data structure.
Syntax
Assignable AssignmentOp Exp
where AssignmentOp may be one of = , += , -= , *= , /= , or ?= .
An Assignable is one of the following:
Description The purpose of an assignment is to assign a new value to a simple variable or to an element of a more complex data structure.
The standard assignment operator is = .
The other assignment operators can be expressed as abbreviations for the standard assignment operator.
An assignable is either a single variable, (the base variable), optionally followed by subscriptions, slices or field selections. The assignment statement always results in assigning a completely new value to the base variable. We distinguish the following forms of assignment:
![]() |