mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 01:55:35 +08:00
update book code
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
// testcrash.go
|
||||
// compiles , but crashes
|
||||
package main
|
||||
|
||||
func main() {
|
||||
var p *int = nil
|
||||
*p = 0
|
||||
|
||||
}
|
||||
// in Windows: stops only with: <exit code="-1073741819" msg="process crashed"/>
|
||||
// runtime error: invalid memory address or nil pointer dereference
|
||||
// testcrash.go
|
||||
// compiles , but crashes
|
||||
package main
|
||||
|
||||
func main() {
|
||||
var p *int = nil
|
||||
*p = 0
|
||||
|
||||
}
|
||||
// in Windows: stops only with: <exit code="-1073741819" msg="process crashed"/>
|
||||
// runtime error: invalid memory address or nil pointer dereference
|
||||
|
Reference in New Issue
Block a user