Assign a value to a variable or more complex data structure.
Assignable AssignmentOp Exp
where AssignmentOp may be one of
An Assignable is one of the following:
Assignable [ Exp ]
Assignable [ Exp .. Exp ]
Assignable [ Exp, Exp .. Exp ]
Assignable . Name
< Assignable, Assignable, ..., Assignable >
Assignable ? Exp
Assignable @ Name
Name ( Assignable, Assignable, ... )
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.
|Assignment Operator||Equivalent to|
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: