Go Concepts - Lexical Structure

From NovaOrdis Knowledge Base
Revision as of 23:52, 21 March 2016 by Ovidiu (talk | contribs)
Jump to navigation Jump to search

Internal



Identifiers

Types, functions, constants, variables, interfaces.

The blank identifier "_".

Identifiers (not values) can be exported or unexported.

Lower-case letter identifiers

Upper-case letter identifiers


Whitespace

Newlines, spaces and tabs.

Expression

Operators combine operands into expressions.

Literal

String Literal

Numeric Literal

Array Literal

Slice Literal

Map Literal

Struct Literal

Comment

// to the end of the line
/*
  Multiline
  line 1
  ...
  line n
*/

Statements

for

if

Keywords

range type func . .
package go . . .
defer chan . . .

Constants