Go语言中的range用法实例分析
package main
import "fmt"
func main() {
pow := make([]int, 10)
for i := range pow {
pow[i] = 1< } for _, value := range pow { fmt.Printf("%d ", value) } }
package main
import "fmt"
func main() {
pow := make([]int, 10)
for i := range pow {
pow[i] = 1< } for _, value := range pow { fmt.Printf("%d ", value) } }