下面是报错: panic: runtime error: invalid memory address or nil pointer dereference [recovered] panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x9cbf96]
goroutine 11583268 [running]: github.com/gogf/gf/os/gtimer.(Entry).Run.func1.1() C:/Users/Administrator/go/pkg/mod/github.com/gogf/gf@v1.16.6/os/gtimer/gtimer_entry.go:47 +0x97 panic({0xa58380, 0x110ce40}) C:/Program Files/Go/src/runtime/panic.go:1038 +0x215 XXX/app/model.(Goods).Test(0xc000235dd0) C:/XXX/app/model/test.go:174 +0xeb6 github.com/gogf/gf/os/gtimer.(Entry).Run.func1() C:/Users/Administrator/go/pkg/mod/github.com/gogf/gf@v1.16.6/os/gtimer/gtimer_entry.go:57 +0x57 created by github.com/gogf/gf/os/gtimer.(Entry).Run C:/Users/Administrator/go/pkg/mod/github.com/gogf/gf@v1.16.6/os/gtimer/gtimer_entry.go:43 +0x87
这个是测试代码
func test(){
var i *int
k := *i
if k == 1 {
log.Println("hello")
}
}