runtime error: invalid memory address or nil pointer dereference
来源:1-1 课程介绍
慕桂英6119265
2021-06-23
访问http://localhost:8080/order报错,运行老师的代码也是这个错误,重要的是老师能不能教下怎么调试,出问题完全不知道是哪里报的
错误日志:
[HTTP Server] http: panic serving 127.0.0.1:65379: runtime error: invalid memory address or nil pointer dereference
goroutine 57 [running]:
net/http.(*conn).serve.func1(0x14000352d20)
/opt/local/lib/go/src/net/http/server.go:1824 +0x108
panic(0x104f17aa0, 0x10557ec30)
/opt/local/lib/go/src/runtime/panic.go:971 +0x3f4
imooc_product/services.(*OrderService).GetAllOrderInfo(...)
/Users/wrz/workspace/GO语言开发/imooc_product/services/order_service.go:47
imooc_product/backend/web/controllers.(*OrderController).Get(0x140002f60d8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/Users/wrz/workspace/GO语言开发/imooc_product/backend/web/controllers/order_controller.go:15 +0x3c
reflect.Value.call(0x140005a8060, 0x140001bec78, 0x13, 0x104cf51a5, 0x4, 0x140002f60c0, 0x1, 0x1, 0x140003443c0, 0x104f043c0, ...)
/opt/local/lib/go/src/reflect/value.go:476 +0x650
reflect.Value.Call(0x140005a8060, 0x140001bec78, 0x13, 0x140002f60c0, 0x1, 0x1, 0x0, 0x10, 0x104d09398)
/opt/local/lib/go/src/reflect/value.go:337 +0x84
github.com/kataras/iris/v12/hero.makeHandler.func2(0x140003443c0)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/hero/handler.go:157 +0x238
github.com/kataras/iris/v12/context.(*Context).Do(...)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/context/context.go:483
github.com/kataras/iris/v12/core/router.(*routerHandler).HandleRequest(0x14000546000, 0x140003443c0)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/core/router/handler.go:440 +0x1b4
github.com/kataras/iris/v12/core/router.(*Router).BuildRouter.func1(0x1050312c0, 0x14000210700, 0x140000aa000)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/core/router/router.go:219 +0x70
github.com/kataras/iris/v12/core/router.(*Router).ServeHTTP(0x140001c0b40, 0x1050312c0, 0x14000210700, 0x140000aa000)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/core/router/router.go:319 +0x44
net/http.serverHandler.ServeHTTP(0x14000386000, 0x1050312c0, 0x14000210700, 0x140000aa000)
/opt/local/lib/go/src/net/http/server.go:2887 +0xbc
net/http.(*conn).serve(0x14000352d20, 0x105033c00, 0x14000044040)
/opt/local/lib/go/src/net/http/server.go:1952 +0x710
created by net/http.(*Server).Serve
/opt/local/lib/go/src/net/http/server.go:3013 +0x308
[HTTP Server] http: panic serving 127.0.0.1:65390: runtime error: invalid memory address or nil pointer dereference
goroutine 10 [running]:
net/http.(*conn).serve.func1(0x140005bc3c0)
/opt/local/lib/go/src/net/http/server.go:1824 +0x108
panic(0x104f17aa0, 0x10557ec30)
/opt/local/lib/go/src/runtime/panic.go:971 +0x3f4
imooc_product/services.(*OrderService).GetAllOrderInfo(...)
/Users/wrz/workspace/GO语言开发/imooc_product/services/order_service.go:47
imooc_product/backend/web/controllers.(*OrderController).Get(0x140002f6360, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/Users/wrz/workspace/GO语言开发/imooc_product/backend/web/controllers/order_controller.go:15 +0x3c
reflect.Value.call(0x140005a8060, 0x140001bec78, 0x13, 0x104cf51a5, 0x4, 0x140002f6348, 0x1, 0x1, 0x140005bc820, 0x104f043c0, ...)
/opt/local/lib/go/src/reflect/value.go:476 +0x650
reflect.Value.Call(0x140005a8060, 0x140001bec78, 0x13, 0x140002f6348, 0x1, 0x1, 0x0, 0x10, 0x104d09398)
/opt/local/lib/go/src/reflect/value.go:337 +0x84
github.com/kataras/iris/v12/hero.makeHandler.func2(0x140005bc820)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/hero/handler.go:157 +0x238
github.com/kataras/iris/v12/context.(*Context).Do(...)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/context/context.go:483
github.com/kataras/iris/v12/core/router.(*routerHandler).HandleRequest(0x14000546000, 0x140005bc820)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/core/router/handler.go:440 +0x1b4
github.com/kataras/iris/v12/core/router.(*Router).BuildRouter.func1(0x1050312c0, 0x140002108c0, 0x1400056a400)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/core/router/router.go:219 +0x70
github.com/kataras/iris/v12/core/router.(*Router).ServeHTTP(0x140001c0b40, 0x1050312c0, 0x140002108c0, 0x1400056a400)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/core/router/router.go:319 +0x44
net/http.serverHandler.ServeHTTP(0x14000386000, 0x1050312c0, 0x140002108c0, 0x1400056a400)
/opt/local/lib/go/src/net/http/server.go:2887 +0xbc
net/http.(*conn).serve(0x140005bc3c0, 0x105033c00, 0x140001d8100)
/opt/local/lib/go/src/net/http/server.go:1952 +0x710
created by net/http.(*Server).Serve
/opt/local/lib/go/src/net/http/server.go:3013 +0x308
[HTTP Server] http: panic serving 127.0.0.1:65381: runtime error: invalid memory address or nil pointer dereference
goroutine 58 [running]:
net/http.(*conn).serve.func1(0x14000352dc0)
/opt/local/lib/go/src/net/http/server.go:1824 +0x108
panic(0x104f17aa0, 0x10557ec30)
/opt/local/lib/go/src/runtime/panic.go:971 +0x3f4
imooc_product/services.(*OrderService).GetAllOrderInfo(...)
/Users/wrz/workspace/GO语言开发/imooc_product/services/order_service.go:47
imooc_product/backend/web/controllers.(*OrderController).Get(0x140002f6510, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/Users/wrz/workspace/GO语言开发/imooc_product/backend/web/controllers/order_controller.go:15 +0x3c
reflect.Value.call(0x140005a8060, 0x140001bec78, 0x13, 0x104cf51a5, 0x4, 0x140002f64e0, 0x1, 0x1, 0x140005bcc80, 0x104f043c0, ...)
/opt/local/lib/go/src/reflect/value.go:476 +0x650
reflect.Value.Call(0x140005a8060, 0x140001bec78, 0x13, 0x140002f64e0, 0x1, 0x1, 0x0, 0x10, 0x104d09398)
/opt/local/lib/go/src/reflect/value.go:337 +0x84
github.com/kataras/iris/v12/hero.makeHandler.func2(0x140005bcc80)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/hero/handler.go:157 +0x238
github.com/kataras/iris/v12/context.(*Context).Do(...)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/context/context.go:483
github.com/kataras/iris/v12/core/router.(*routerHandler).HandleRequest(0x14000546000, 0x140005bcc80)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/core/router/handler.go:440 +0x1b4
github.com/kataras/iris/v12/core/router.(*Router).BuildRouter.func1(0x1050312c0, 0x14000210a80, 0x1400056a000)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/core/router/router.go:219 +0x70
github.com/kataras/iris/v12/core/router.(*Router).ServeHTTP(0x140001c0b40, 0x1050312c0, 0x14000210a80, 0x1400056a000)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/core/router/router.go:319 +0x44
net/http.serverHandler.ServeHTTP(0x14000386000, 0x1050312c0, 0x14000210a80, 0x1400056a000)
/opt/local/lib/go/src/net/http/server.go:2887 +0xbc
net/http.(*conn).serve(0x14000352dc0, 0x105033c00, 0x1400011fec0)
/opt/local/lib/go/src/net/http/server.go:1952 +0x710
created by net/http.(*Server).Serve
/opt/local/lib/go/src/net/http/server.go:3013 +0x308
[HTTP Server] http: panic serving 127.0.0.1:65386: runtime error: invalid memory address or nil pointer dereference
goroutine 70 [running]:
net/http.(*conn).serve.func1(0x140005bcaa0)
/opt/local/lib/go/src/net/http/server.go:1824 +0x108
panic(0x104f17aa0, 0x10557ec30)
/opt/local/lib/go/src/runtime/panic.go:971 +0x3f4
imooc_product/services.(*OrderService).GetAllOrderInfo(...)
/Users/wrz/workspace/GO语言开发/imooc_product/services/order_service.go:47
imooc_product/backend/web/controllers.(*OrderController).Get(0x1400000e090, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/Users/wrz/workspace/GO语言开发/imooc_product/backend/web/controllers/order_controller.go:15 +0x3c
reflect.Value.call(0x140005a8060, 0x140001bec78, 0x13, 0x104cf51a5, 0x4, 0x1400000e060, 0x1, 0x1, 0x140003521e0, 0x104f043c0, ...)
/opt/local/lib/go/src/reflect/value.go:476 +0x650
reflect.Value.Call(0x140005a8060, 0x140001bec78, 0x13, 0x1400000e060, 0x1, 0x1, 0x0, 0x10, 0x104d09398)
/opt/local/lib/go/src/reflect/value.go:337 +0x84
github.com/kataras/iris/v12/hero.makeHandler.func2(0x140003521e0)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/hero/handler.go:157 +0x238
github.com/kataras/iris/v12/context.(*Context).Do(...)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/context/context.go:483
github.com/kataras/iris/v12/core/router.(*routerHandler).HandleRequest(0x14000546000, 0x140003521e0)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/core/router/handler.go:440 +0x1b4
github.com/kataras/iris/v12/core/router.(*Router).BuildRouter.func1(0x1050312c0, 0x1400032c1c0, 0x1400066e100)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/core/router/router.go:219 +0x70
github.com/kataras/iris/v12/core/router.(*Router).ServeHTTP(0x140001c0b40, 0x1050312c0, 0x1400032c1c0, 0x1400066e100)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/core/router/router.go:319 +0x44
net/http.serverHandler.ServeHTTP(0x14000386000, 0x1050312c0, 0x1400032c1c0, 0x1400066e100)
/opt/local/lib/go/src/net/http/server.go:2887 +0xbc
net/http.(*conn).serve(0x140005bcaa0, 0x105033c00, 0x140001d8300)
/opt/local/lib/go/src/net/http/server.go:1952 +0x710
created by net/http.(*Server).Serve
/opt/local/lib/go/src/net/http/server.go:3013 +0x308
[HTTP Server] http: panic serving 127.0.0.1:65388: runtime error: invalid memory address or nil pointer dereference
goroutine 26 [running]:
net/http.(*conn).serve.func1(0x14000352460)
/opt/local/lib/go/src/net/http/server.go:1824 +0x108
panic(0x104f17aa0, 0x10557ec30)
/opt/local/lib/go/src/runtime/panic.go:971 +0x3f4
imooc_product/services.(*OrderService).GetAllOrderInfo(...)
/Users/wrz/workspace/GO语言开发/imooc_product/services/order_service.go:47
imooc_product/backend/web/controllers.(*OrderController).Get(0x140001b6cf0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/Users/wrz/workspace/GO语言开发/imooc_product/backend/web/controllers/order_controller.go:15 +0x3c
reflect.Value.call(0x140005a8060, 0x140001bec78, 0x13, 0x104cf51a5, 0x4, 0x140001b6cd8, 0x1, 0x1, 0x140001babe0, 0x104f043c0, ...)
/opt/local/lib/go/src/reflect/value.go:476 +0x650
reflect.Value.Call(0x140005a8060, 0x140001bec78, 0x13, 0x140001b6cd8, 0x1, 0x1, 0x0, 0x10, 0x104d09398)
/opt/local/lib/go/src/reflect/value.go:337 +0x84
github.com/kataras/iris/v12/hero.makeHandler.func2(0x140001babe0)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/hero/handler.go:157 +0x238
github.com/kataras/iris/v12/context.(*Context).Do(...)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/context/context.go:483
github.com/kataras/iris/v12/core/router.(*routerHandler).HandleRequest(0x14000546000, 0x140001babe0)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/core/router/handler.go:440 +0x1b4
github.com/kataras/iris/v12/core/router.(*Router).BuildRouter.func1(0x1050312c0, 0x140006ca380, 0x140005fa400)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/core/router/router.go:219 +0x70
github.com/kataras/iris/v12/core/router.(*Router).ServeHTTP(0x140001c0b40, 0x1050312c0, 0x140006ca380, 0x140005fa400)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/core/router/router.go:319 +0x44
net/http.serverHandler.ServeHTTP(0x14000386000, 0x1050312c0, 0x140006ca380, 0x140005fa400)
/opt/local/lib/go/src/net/http/server.go:2887 +0xbc
net/http.(*conn).serve(0x14000352460, 0x105033c00, 0x140005b21c0)
/opt/local/lib/go/src/net/http/server.go:1952 +0x710
created by net/http.(*Server).Serve
/opt/local/lib/go/src/net/http/server.go:3013 +0x308
[HTTP Server] http: panic serving 127.0.0.1:65385: runtime error: invalid memory address or nil pointer dereference
goroutine 69 [running]:
net/http.(*conn).serve.func1(0x140005bc960)
/opt/local/lib/go/src/net/http/server.go:1824 +0x108
panic(0x104f17aa0, 0x10557ec30)
/opt/local/lib/go/src/runtime/panic.go:971 +0x3f4
imooc_product/services.(*OrderService).GetAllOrderInfo(...)
/Users/wrz/workspace/GO语言开发/imooc_product/services/order_service.go:47
imooc_product/backend/web/controllers.(*OrderController).Get(0x140001b6e70, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/Users/wrz/workspace/GO语言开发/imooc_product/backend/web/controllers/order_controller.go:15 +0x3c
reflect.Value.call(0x140005a8060, 0x140001bec78, 0x13, 0x104cf51a5, 0x4, 0x140001b6e40, 0x1, 0x1, 0x1400021e5a0, 0x104f043c0, ...)
/opt/local/lib/go/src/reflect/value.go:476 +0x650
reflect.Value.Call(0x140005a8060, 0x140001bec78, 0x13, 0x140001b6e40, 0x1, 0x1, 0x0, 0x10, 0x104d09398)
/opt/local/lib/go/src/reflect/value.go:337 +0x84
github.com/kataras/iris/v12/hero.makeHandler.func2(0x1400021e5a0)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/hero/handler.go:157 +0x238
github.com/kataras/iris/v12/context.(*Context).Do(...)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/context/context.go:483
github.com/kataras/iris/v12/core/router.(*routerHandler).HandleRequest(0x14000546000, 0x1400021e5a0)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/core/router/handler.go:440 +0x1b4
github.com/kataras/iris/v12/core/router.(*Router).BuildRouter.func1(0x1050312c0, 0x140006ca540, 0x14000174000)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/core/router/router.go:219 +0x70
github.com/kataras/iris/v12/core/router.(*Router).ServeHTTP(0x140001c0b40, 0x1050312c0, 0x140006ca540, 0x14000174000)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/core/router/router.go:319 +0x44
net/http.serverHandler.ServeHTTP(0x14000386000, 0x1050312c0, 0x140006ca540, 0x14000174000)
/opt/local/lib/go/src/net/http/server.go:2887 +0xbc
net/http.(*conn).serve(0x140005bc960, 0x105033c00, 0x140005b2440)
/opt/local/lib/go/src/net/http/server.go:1952 +0x710
created by net/http.(*Server).Serve
/opt/local/lib/go/src/net/http/server.go:3013 +0x308
[HTTP Server] http: panic serving 127.0.0.1:65395: runtime error: invalid memory address or nil pointer dereference
goroutine 75 [running]:
net/http.(*conn).serve.func1(0x14000344000)
/opt/local/lib/go/src/net/http/server.go:1824 +0x108
panic(0x104f17aa0, 0x10557ec30)
/opt/local/lib/go/src/runtime/panic.go:971 +0x3f4
imooc_product/services.(*OrderService).GetAllOrderInfo(...)
/Users/wrz/workspace/GO语言开发/imooc_product/services/order_service.go:47
imooc_product/backend/web/controllers.(*OrderController).Get(0x140001b6f18, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/Users/wrz/workspace/GO语言开发/imooc_product/backend/web/controllers/order_controller.go:15 +0x3c
reflect.Value.call(0x140005a8060, 0x140001bec78, 0x13, 0x104cf51a5, 0x4, 0x140001b6f00, 0x1, 0x1, 0x1400021e6e0, 0x104f043c0, ...)
/opt/local/lib/go/src/reflect/value.go:476 +0x650
reflect.Value.Call(0x140005a8060, 0x140001bec78, 0x13, 0x140001b6f00, 0x1, 0x1, 0x0, 0x10, 0x104d09398)
/opt/local/lib/go/src/reflect/value.go:337 +0x84
github.com/kataras/iris/v12/hero.makeHandler.func2(0x1400021e6e0)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/hero/handler.go:157 +0x238
github.com/kataras/iris/v12/context.(*Context).Do(...)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/context/context.go:483
github.com/kataras/iris/v12/core/router.(*routerHandler).HandleRequest(0x14000546000, 0x1400021e6e0)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/core/router/handler.go:440 +0x1b4
github.com/kataras/iris/v12/core/router.(*Router).BuildRouter.func1(0x1050312c0, 0x140006ca700, 0x1400056a700)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/core/router/router.go:219 +0x70
github.com/kataras/iris/v12/core/router.(*Router).ServeHTTP(0x140001c0b40, 0x1050312c0, 0x140006ca700, 0x1400056a700)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/core/router/router.go:319 +0x44
net/http.serverHandler.ServeHTTP(0x14000386000, 0x1050312c0, 0x140006ca700, 0x1400056a700)
/opt/local/lib/go/src/net/http/server.go:2887 +0xbc
net/http.(*conn).serve(0x14000344000, 0x105033c00, 0x140001d8780)
/opt/local/lib/go/src/net/http/server.go:1952 +0x710
created by net/http.(*Server).Serve
/opt/local/lib/go/src/net/http/server.go:3013 +0x308
[HTTP Server] http: panic serving 127.0.0.1:65400: runtime error: invalid memory address or nil pointer dereference
goroutine 147 [running]:
net/http.(*conn).serve.func1(0x140005bce60)
/opt/local/lib/go/src/net/http/server.go:1824 +0x108
panic(0x104f17aa0, 0x10557ec30)
/opt/local/lib/go/src/runtime/panic.go:971 +0x3f4
imooc_product/services.(*OrderService).GetAllOrderInfo(...)
/Users/wrz/workspace/GO语言开发/imooc_product/services/order_service.go:47
imooc_product/backend/web/controllers.(*OrderController).Get(0x140001b7368, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/Users/wrz/workspace/GO语言开发/imooc_product/backend/web/controllers/order_controller.go:15 +0x3c
reflect.Value.call(0x140005a8060, 0x140001bec78, 0x13, 0x104cf51a5, 0x4, 0x140001b71d0, 0x1, 0x1, 0x1400021e820, 0x104f043c0, ...)
/opt/local/lib/go/src/reflect/value.go:476 +0x650
reflect.Value.Call(0x140005a8060, 0x140001bec78, 0x13, 0x140001b71d0, 0x1, 0x1, 0x0, 0x10, 0x104d09398)
/opt/local/lib/go/src/reflect/value.go:337 +0x84
github.com/kataras/iris/v12/hero.makeHandler.func2(0x1400021e820)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/hero/handler.go:157 +0x238
github.com/kataras/iris/v12/context.(*Context).Do(...)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/context/context.go:483
github.com/kataras/iris/v12/core/router.(*routerHandler).HandleRequest(0x14000546000, 0x1400021e820)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/core/router/handler.go:440 +0x1b4
github.com/kataras/iris/v12/core/router.(*Router).BuildRouter.func1(0x1050312c0, 0x140006ca8c0, 0x140000aa200)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/core/router/router.go:219 +0x70
github.com/kataras/iris/v12/core/router.(*Router).ServeHTTP(0x140001c0b40, 0x1050312c0, 0x140006ca8c0, 0x140000aa200)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/core/router/router.go:319 +0x44
net/http.serverHandler.ServeHTTP(0x14000386000, 0x1050312c0, 0x140006ca8c0, 0x140000aa200)
/opt/local/lib/go/src/net/http/server.go:2887 +0xbc
net/http.(*conn).serve(0x140005bce60, 0x105033c00, 0x1400022b340)
/opt/local/lib/go/src/net/http/server.go:1952 +0x710
created by net/http.(*Server).Serve
/opt/local/lib/go/src/net/http/server.go:3013 +0x308
[HTTP Server] http: panic serving 127.0.0.1:65401: runtime error: invalid memory address or nil pointer dereference
goroutine 148 [running]:
net/http.(*conn).serve.func1(0x140005bd040)
/opt/local/lib/go/src/net/http/server.go:1824 +0x108
panic(0x104f17aa0, 0x10557ec30)
/opt/local/lib/go/src/runtime/panic.go:971 +0x3f4
imooc_product/services.(*OrderService).GetAllOrderInfo(...)
/Users/wrz/workspace/GO语言开发/imooc_product/services/order_service.go:47
imooc_product/backend/web/controllers.(*OrderController).Get(0x140002f6690, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/Users/wrz/workspace/GO语言开发/imooc_product/backend/web/controllers/order_controller.go:15 +0x3c
reflect.Value.call(0x140005a8060, 0x140001bec78, 0x13, 0x104cf51a5, 0x4, 0x140002f6660, 0x1, 0x1, 0x140005bd220, 0x104f043c0, ...)
/opt/local/lib/go/src/reflect/value.go:476 +0x650
reflect.Value.Call(0x140005a8060, 0x140001bec78, 0x13, 0x140002f6660, 0x1, 0x1, 0x0, 0x10, 0x104d09398)
/opt/local/lib/go/src/reflect/value.go:337 +0x84
github.com/kataras/iris/v12/hero.makeHandler.func2(0x140005bd220)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/hero/handler.go:157 +0x238
github.com/kataras/iris/v12/context.(*Context).Do(...)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/context/context.go:483
github.com/kataras/iris/v12/core/router.(*routerHandler).HandleRequest(0x14000546000, 0x140005bd220)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/core/router/handler.go:440 +0x1b4
github.com/kataras/iris/v12/core/router.(*Router).BuildRouter.func1(0x1050312c0, 0x14000210c40, 0x140005fa100)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/core/router/router.go:219 +0x70
github.com/kataras/iris/v12/core/router.(*Router).ServeHTTP(0x140001c0b40, 0x1050312c0, 0x14000210c40, 0x140005fa100)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/core/router/router.go:319 +0x44
net/http.serverHandler.ServeHTTP(0x14000386000, 0x1050312c0, 0x14000210c40, 0x140005fa100)
/opt/local/lib/go/src/net/http/server.go:2887 +0xbc
net/http.(*conn).serve(0x140005bd040, 0x105033c00, 0x140002d0cc0)
/opt/local/lib/go/src/net/http/server.go:1952 +0x710
created by net/http.(*Server).Serve
/opt/local/lib/go/src/net/http/server.go:3013 +0x308
[HTTP Server] http: panic serving 127.0.0.1:65403: runtime error: invalid memory address or nil pointer dereference
goroutine 76 [running]:
net/http.(*conn).serve.func1(0x14000344140)
/opt/local/lib/go/src/net/http/server.go:1824 +0x108
panic(0x104f17aa0, 0x10557ec30)
/opt/local/lib/go/src/runtime/panic.go:971 +0x3f4
imooc_product/services.(*OrderService).GetAllOrderInfo(...)
/Users/wrz/workspace/GO语言开发/imooc_product/services/order_service.go:47
imooc_product/backend/web/controllers.(*OrderController).Get(0x1400000e570, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/Users/wrz/workspace/GO语言开发/imooc_product/backend/web/controllers/order_controller.go:15 +0x3c
reflect.Value.call(0x140005a8060, 0x140001bec78, 0x13, 0x104cf51a5, 0x4, 0x1400000e3f0, 0x1, 0x1, 0x14000344500, 0x104f043c0, ...)
/opt/local/lib/go/src/reflect/value.go:476 +0x650
reflect.Value.Call(0x140005a8060, 0x140001bec78, 0x13, 0x1400000e3f0, 0x1, 0x1, 0x0, 0x10, 0x104d09398)
/opt/local/lib/go/src/reflect/value.go:337 +0x84
github.com/kataras/iris/v12/hero.makeHandler.func2(0x14000344500)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/hero/handler.go:157 +0x238
github.com/kataras/iris/v12/context.(*Context).Do(...)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/context/context.go:483
github.com/kataras/iris/v12/core/router.(*routerHandler).HandleRequest(0x14000546000, 0x14000344500)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/core/router/handler.go:440 +0x1b4
github.com/kataras/iris/v12/core/router.(*Router).BuildRouter.func1(0x1050312c0, 0x1400032c380, 0x1400056a800)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/core/router/router.go:219 +0x70
github.com/kataras/iris/v12/core/router.(*Router).ServeHTTP(0x140001c0b40, 0x1050312c0, 0x1400032c380, 0x1400056a800)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/core/router/router.go:319 +0x44
net/http.serverHandler.ServeHTTP(0x14000386000, 0x1050312c0, 0x1400032c380, 0x1400056a800)
/opt/local/lib/go/src/net/http/server.go:2887 +0xbc
net/http.(*conn).serve(0x14000344140, 0x105033c00, 0x140001d8800)
/opt/local/lib/go/src/net/http/server.go:1952 +0x710
created by net/http.(*Server).Serve
/opt/local/lib/go/src/net/http/server.go:3013 +0x308
[HTTP Server] http: panic serving 127.0.0.1:65409: runtime error: invalid memory address or nil pointer dereference
goroutine 135 [running]:
net/http.(*conn).serve.func1(0x1400021e960)
/opt/local/lib/go/src/net/http/server.go:1824 +0x108
panic(0x104f17aa0, 0x10557ec30)
/opt/local/lib/go/src/runtime/panic.go:971 +0x3f4
imooc_product/services.(*OrderService).GetAllOrderInfo(...)
/Users/wrz/workspace/GO语言开发/imooc_product/services/order_service.go:47
imooc_product/backend/web/controllers.(*OrderController).Get(0x1400000e720, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/Users/wrz/workspace/GO语言开发/imooc_product/backend/web/controllers/order_controller.go:15 +0x3c
reflect.Value.call(0x140005a8060, 0x140001bec78, 0x13, 0x104cf51a5, 0x4, 0x1400000e708, 0x1, 0x1, 0x14000344640, 0x104f043c0, ...)
/opt/local/lib/go/src/reflect/value.go:476 +0x650
reflect.Value.Call(0x140005a8060, 0x140001bec78, 0x13, 0x1400000e708, 0x1, 0x1, 0x0, 0x10, 0x104d09398)
/opt/local/lib/go/src/reflect/value.go:337 +0x84
github.com/kataras/iris/v12/hero.makeHandler.func2(0x14000344640)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/hero/handler.go:157 +0x238
github.com/kataras/iris/v12/context.(*Context).Do(...)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/context/context.go:483
github.com/kataras/iris/v12/core/router.(*routerHandler).HandleRequest(0x14000546000, 0x14000344640)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/core/router/handler.go:440 +0x1b4
github.com/kataras/iris/v12/core/router.(*Router).BuildRouter.func1(0x1050312c0, 0x1400032c540, 0x1400056a900)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/core/router/router.go:219 +0x70
github.com/kataras/iris/v12/core/router.(*Router).ServeHTTP(0x140001c0b40, 0x1050312c0, 0x1400032c540, 0x1400056a900)
/Users/wrz/go/pkg/mod/github.com/kataras/iris/v12@v12.2.0-alpha2.0.20210607123319-8f9140b70501/core/router/router.go:319 +0x44
net/http.serverHandler.ServeHTTP(0x14000386000, 0x1050312c0, 0x1400032c540, 0x1400056a900)
/opt/local/lib/go/src/net/http/server.go:2887 +0xbc
net/http.(*conn).serve(0x1400021e960, 0x105033c00, 0x140001d8900)
/opt/local/lib/go/src/net/http/server.go:1952 +0x710
created by net/http.(*Server).Serve
/opt/local/lib/go/src/net/http/server.go:3013 +0x308
写回答
1回答
-
Cap
2021-06-28
编辑器里面的错误日志有吗
012021-06-28
相似问题