执行go test报错如下,请问这是什么意思?
来源:3-12 api之数据库层实现_实现和验证Video
慕粉3536494
2020-02-21
admindeMBP:dbopt admin$ go test
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=0x125033a]
goroutine 42 [running]:
testing.tRunner.func1(0xc00010c800)
/usr/local/go/src/testing/testing.go:874 +0x3a3
panic(0x1290240, 0x14d1040)
/usr/local/go/src/runtime/panic.go:679 +0x1b2
video1/api/dbopt.TestAddVideo(0xc00010c800)
/Users/admin/goworkspace/src/video1/api/dbopt/api_test.go:77 +0xba
testing.tRunner(0xc00010c800, 0x12f0580)
/usr/local/go/src/testing/testing.go:909 +0xc9
created by testing.(*T).Run
/usr/local/go/src/testing/testing.go:960 +0x350
exit status 2
FAIL video1/api/dbopt 1.647s
admindeMBP:dbopt admin$
1回答
-
空指针了,看看有没有declare却没有赋值的指针
012020-03-03
相似问题