Files
the-way-to-go_ZH_CN/eBook/exercises/chapter_4/local_scope.go
2015-03-03 12:25:25 -05:00

17 lines
201 B
Go
Executable File

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