mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 01:21:38 +08:00
15 lines
199 B
Go
Executable File
15 lines
199 B
Go
Executable File
// i_undefined.go
|
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
func main() {
|
|
var i int
|
|
for i=0; i<10; i++ {
|
|
fmt.Printf("%v\n", i)
|
|
}
|
|
fmt.Printf("%v\n", i) //<-- compile error: undefined i
|
|
}
|