mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 03:06:41 +08:00
15 lines
304 B
Go
15 lines
304 B
Go
package main
|
|
import "fmt"
|
|
|
|
func main() {
|
|
seasons := []string{"Spring", "Summer", "Autumn", "Winter"}
|
|
for ix, season := range seasons {
|
|
fmt.Printf("Season %d is: %s\n", ix, season)
|
|
}
|
|
|
|
var season string
|
|
for _, season = range seasons {
|
|
fmt.Printf("%s\n", season)
|
|
}
|
|
}
|