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

19 lines
185 B
Go

package main
var a = "G" // global scope
func main() {
n()
m()
n()
}
func n() {
print(a)
}
func m() {
a = "O" // simple assignment: global a gets a new value
print(a)
}
// GOO