Go Language Basics

Google has introduced the New open sourced programming language “Go”.
Go is a

New
Experimental
Concurrent
Garbage-collected
Systems Language

Lexical structure

Source is UTF-8. White space: blank, tab, newline.
Identifiers are alphanumeric (plus ‘_’) with “alpha” and “numeric” defined by Unicode.

Comments:
/* This is a comment; no nesting */
// So is this.
Literals
C-like but numbers require no signedness or size markings
Example:
23
0×0FF
1.234e7
C-like strings, but Unicode/UTF-8. Also \xNN [...]

Google has introduced the New open sourced programming language “Go”.

Go is a

  • New
  • Experimental
  • Concurrent
  • Garbage-collected
  • Systems Language

Lexical structure

  • Source is UTF-8. White space: blank, tab, newline.
  • Identifiers are alphanumeric (plus ‘_’) with “alpha” and “numeric” defined by Unicode.

Comments:

/* This is a comment; no nesting */

// So is this.

Literals

C-like but numbers require no signedness or size markings

Example:

23

0×0FF

1.234e7

C-like strings, but Unicode/UTF-8. Also \xNN always 2 digits; \012 always 3; both are bytes.

Example:


“Hello, world\n”

“\xFF” // 1 byte

“\u00FF” // 1 unicode char, 2 bytes of UTF-8

Example:

Raw strings

`\n\.abc\t\` == “\\n\\.abc\\t\\”

No related posts.