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

19 lines
203 B
Go
Executable File

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