1 개요[ | ]
Go panic: assignment to entry in nil map
Go
CPU
-1.0s
MEM
-0M
-1.0s
Copy
package main
import "fmt"
func main() {
var labels map[string]string
labels["hello"] = "world"
fmt.Println(labels)
}
panic: assignment to entry in nil map goroutine 1 [running]: main.main() /home/user01/runbox.go:7 +0x32 exit status 2
Go
Copy
package main
import "fmt"
func main() {
labels := map[string]string{}
labels["hello"] = "world"
fmt.Println(labels)
}
Loading
Go
Copy
package main
import "fmt"
func main() {
labels := make(map[string]string)
labels["hello"] = "world"
fmt.Println(labels)
}
Loading
2 같이 보기[ | ]
3 참고[ | ]
편집자 Jmnote
로그인하시면 댓글을 쓸 수 있습니다.