mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 07:02:11 +08:00
17 lines
201 B
Go
Executable File
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 |