You are here: >

Golang

GolangGo, also known as golang, is a computer programming language whose development began in 2007 at Google, and it was introduced to the public in 2009.

Go's three lead developers at Google were Robert Griesemer, Rob Pike, and Ken Thompson. Their goal was to create a language, loosely based on the syntax of the C programming language, which would eliminate the "extraneous garbage" of languages such as C++. As a result, Go eschews many features of other modern languages, such as method and operator overloading, pointer arithmetic, and type inheritance.

Go is not a free-form language: its conventions specify many formatting details, including how indentation and spaces are to be used. The language requires that none of its declared variables or imported libraries are unused, and all return statements are compulsory.

Go employs "type inference" in variable declarations: the variable type, rather than being an explicit part of the declaration statement, is inferred by the value type itself. For example, where in C an integer variable x could be set to the value 0 with the statement.

int x = 0;

In Go the equivalent statement would be:

x := 0

The variable would be typed as an integer based on the value itself.

Here is the classic "Hello, World!" program, as written in Go:

package main 

import "fmt" 

func main() { 
    fmt.Println("Hello, World")
} 

Related Pages

Also see: Programming language, Programming terms