Identifiers
A Go identifier is a name used to identify a variable, function, or any other user-defined item. An identifier starts with a letter A to Z or a to z or an underscore _ followed by zero or more letters, underscores, and digits (0 to 9).
identifier = letter { letter | unicode_digit }.
Go does not allow punctuation characters such as @, $, and % within identifiers. Go is a case-sensitive programming language. Thus, Manpowerand manpower are two different identifiers in Go. Here are some examples of acceptable identifiers −
mahesh kumar abc move_name a_123
myname50 _temp j a23b9 retVal
Keywords
The following list shows the reserved words in Go. These reserved words may not be used as constant or variable or any other identifier names.
break |
default |
func |
interface |
select |
case |
defer |
Go |
map |
Struct |
chan |
else |
Goto |
package |
Switch |
const |
fallthrough |
if |
range |
Type |
continue |
for |
import |
return |
Var |