Slide 6
Slide 6 text
1
• ( . : D
package main
import (
"fmt"
)
func main() {
array := [4]string{}
fruits := []string{
"apple",
"orange",
"grape",
"kiwi",
"pineapple",
}
for i, f := range fruits {
array[i] = f
}
fmt.Printf("%#v", array)
}
panic: runtime error: index out of range
goroutine 1 [running]: main.main()
/tmp/sandbox760713094/main.go:17 +0x160
Program exited: status 2.
: :
• ) (/ 1(. : ac
• 7. : D
• 67 b
• . 7 f e