Go (often referred to as golang) is a free and open source programming language created at Google in 2007 by Robert Griesemer, Rob Pike, and Ken Thompson. It is a compiled, statically typed language in the tradition of Algol and C, with garbage collection, limited structural typing, memory safety features and CSP-style concurrent programming features added. The compiler and other language tools originally developed by Google are all free and open source.
The language was announced in November 2009; it is used in some of Google's production systems, as well as by other firms.
Go is a statically typed, compiled language in the tradition of C, with memory safety, garbage collection, structural typing, and CSP-style concurrency. The compiler, tools, and source code are all free and open source.
Go's syntax includes changes from C aimed at keeping code concise and readable. A combined declaration/initialization operator was introduced that allows the programmer to write i := 3 or s := "Hello world" instead of int i = 3 or char *s = "Hello world".
Go's declaration syntax omits the type of the variable if it is the same as its initial value; this contrasts with C, where the type of the variable is always explicitly declared. If the type is omitted, the compiler uses the initial value to infer the type, by looking at the first assignment in the statement. For instance, i := 0 declares and initializes a variable i of type int, and s := "" declares and initializes a variable s of type string. This contrasts with traditional C, where variable declarations must be of the form int i = 0; and char *s = "";
Go has pointers but no pointer arithmetic. Struct fields can be accessed through a struct pointer. The -> operator that is present in other languages is not available in Go. Instead, the fields of a struct are accessed using the . operator. The * operator can also be used in front of a struct pointer variable name to access its fields, e.g