저는 go to new이고 이동 중에 struct 배열을 만들고 초기화하려고합니다. 내 코드는 다음과 같은 에러가 발생이구조체를 Go 언어로 배열합니다.
type node struct {
name string
children map[string]int
}
cities:= []node{node{}}
for i := 0; i<47 ;i++ {
cities[i].name=strconv.Itoa(i)
cities[i].children=make(map[string]int)
}
같다 :
panic: runtime error: index out of range
goroutine 1 [running]:
panic(0xa6800, 0xc42000a080)
도와주세요. TIA :
어쩌면 당신은 한번 더 투어를 이용할 수 있을까요?. – Volker