This is a creation in Article, where the information may have evolved or changed.
Introduction
Golang Reference Manual For more information, please refer to http://golang.org
Language Specification reference from Https://golang.org/ref/spec
Lexical elements
Comments
Line Comment: // comment content
Paragraph notes:/* comment content */
Symbol
There are 4 types of symbols: identifiers, keywords, operators and separators, literal constants
Semicolon
Golang, semicolons can be omitted
Identifier
Identifiers are variables and types in a program, with one or more letters or numbers, and the first letter must begin with a letter.
identifier = letter { letter | unicode_digit }
Key words
Identifier cannot be a reserved keyword in Golang
Break default func Interface Select Case defer Go Map structChan Else Goto Package SwitchConst Fallthrough if Range typeContinue for Import return var
Operators and separators
The operators, separators, and other special symbols in the Golang as shown below
+ & += &= && == != ( )- | -= |= || < <= [ ]* ^ *= ^= <- > >= { }/ << /= <<= ++ = := , ;% >> %= >>= -- ! ... . : &^ &^=
Shaping literal
Shaping literals are shaped constants represented by a sequence of numbers, which can be prefixed by 0 or 0x, representing 8 binary and 16 binary numbers, respectively.
int_lit "1""9"{ decimal_digit } .octal_lit "0"{ octal_digit } .hex_lit "0""x""X"{ hex_digit } .4206000xBadFace170141183460469231731687303715884105727
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.