mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 06:36:43 +08:00
19 lines
203 B
Go
Executable File
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 |