gobyexample/003-variables.go
2012-09-20 22:09:22 -07:00

18 lines
336 B
Go

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