Category: Basics

Go Language Syntax Overview

Syntax overview
Basically C-like with reversed types and declarations, plus keywords to introduce each type of declaration.
Example:
var a int
var b, c *int // note difference from C
var d []int
type S struct { a, b int }

Basic control structures are familiar:
if a == b { return true } else { return false }
for i = 0; i [...]

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 [...]

Page 2 of 2«12