gobyexample/003-variables/variables.go
2012-09-23 18:31:33 -07:00

17 lines
294 B
Go

// ## Variables
package main
import "fmt"
func main() {
// `var` declares 1 or more variables. The type comes
// at the end.
var x string = "Hello world"
fmt.Println(x)
// An example of declaring multiple `int` variables.
var a, b int = 1, 2
fmt.Println(a, b)
}