![WX20220517-190539@2x.png](https://static.golangjob.cn/220517/f50f65adc06aea2eceb5f6d750102360.png)
```go
runtime error: invalid memory address or nil pointer dereference
/opt/homebrew/Cellar/go/1.18/libexec/src/runtime/panic.go:220 (0x1042418fb)
panicmem: panic(memoryError)
/opt/homebrew/Cellar/go/1.18/libexec/src/runtime/signal_unix.go:818 (0x10425958b)
sigpanic: panicmem()
/Users/handsomejob/go项目/goshop/utils/captcha/captcha.go:23 (0x10494f124)
Captcha: session.Values["captchaCode"] = captchaId
/Users/handsomejob/go项目/goshop/app/v1/route/route.go:22 (0x10495156f)
Routers.func1: captcha.Captcha(ctx)
/Users/handsomejob/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/context.go:168 (0x10492007f)
(*Context).Next: c.handlers[c.index](c)
/Users/handsomejob/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/recovery.go:99 (0x104920060)
CustomRecoveryWithWriter.func1: c.Next()
/Users/handsomejob/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/context.go:168 (0x10491f32f)
(*Context).Next: c.handlers[c.index](c)
/Users/handsomejob/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/logger.go:241 (0x10491f30c)
LoggerWithConfig.func1: c.Next()
/Users/handsomejob/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/context.go:168 (0x10491e497)
(*Context).Next: c.handlers[c.index](c)
/Users/handsomejob/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/gin.go:555 (0x10491e16c)
(*Engine).handleHTTPRequest: c.Next()
/Users/handsomejob/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/gin.go:511 (0x10491dd83)
(*Engine).ServeHTTP: engine.handleHTTPRequest(c)
/opt/homebrew/Cellar/go/1.18/libexec/src/net/http/server.go:2916 (0x1044fedfb)
serverHandler.ServeHTTP: handler.ServeHTTP(rw, req)
/opt/homebrew/Cellar/go/1.18/libexec/src/net/http/server.go:1966 (0x1044fa51b)
(*conn).serve: serverHandler{c.server}.ServeHTTP(w, w.req)
/opt/homebrew/Cellar/go/1.18/libexec/src/runtime/asm_arm64.s:1259 (0x1042729e3)
goexit: MOVD R0, R0 // NOP
```
有疑问加站长微信联系(非本文作者)