Go

From air
Revision as of 15:27, 5 January 2014 by Donsez (talk | contribs) (Created page with "http://golang.org/ ''Go is an open source programming language that makes it easy to build simple, reliable, and efficient software. '' Example: <pre> package main import "...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

http://golang.org/

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

Example:

package main

import "fmt"

// fib returns a function that returns
// successive Fibonacci numbers.
func fib() func() int {
	a, b := 0, 1
	return func() int {
		a, b = b, a+b
		return a
	}
}

func main() {
	f := fib()
	// Function calls are evaluated left-to-right.
	fmt.Println(f(), f(), f(), f(), f())
}