Files
the-way-to-go_ZH_CN/eBook/exercises/chapter_4/local_scope.go
2013-06-09 20:18:11 +08:00

17 lines
185 B
Go

package main
var a = "G" // global (package) scope
func main() {
n()
m()
n()
}
func n() {
print(a)
}
func m() {
a := "O" // new local variable a is declared
print(a)
}
// GOG