Files
the-way-to-go_ZH_CN/eBook/exercises/chapter_4/local_scope.go
2017-02-10 16:33:02 +08:00

19 lines
184 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