gin-contrib / sessions

Gin middleware for session management
MIT License
1.46k stars 196 forks source link

ERR : Key "github.com/gin-contrib/sessions" does not exist #190

Open zhuangyuantao opened 2 years ago

zhuangyuantao commented 2 years ago

ERR Key "github.com/gin-contrib/sessions" does not exist E:/work/project/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:272 (0xdf5798) (Context).MustGet: panic("Key \"" + key + "\" does not exist") E:/work/project/pkg/mod/github.com/gin-contrib/sessions@v0.0.5/sessions.go:146 (0xdf5718) Default: return c.MustGet(DefaultKey).(Session) E:/work/learn/gin_study/controller/sessionController.go:11 (0xdf5c8f) SetSession: session := sessions.Default(c) E:/work/learn/gin_study/controller/loginController.go:32 (0xdf5aa4) LoginController.Login: SetSession(c) E:/work/project/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173 (0xdeb761) (Context).Next: c.handlersc.index E:/work/project/pkg/mod/github.com/gin-gonic/gin@v1.8.1/recovery.go:101 (0xdeb74c) CustomRecoveryWithWriter.func1: c.Next() E:/work/project/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173 (0xdea846) (Context).Next: c.handlersc.index E:/work/project/pkg/mod/github.com/gin-gonic/gin@v1.8.1/logger.go:240 (0xdea829) LoggerWithConfig.func1: c.Next() C:/Program Files/Go/src/net/http/server.go:1966 (0xc53d36) (conn).serve: serverHandler{c.server}.ServeHTTP(w, w.req) C:/Program Files/Go/src/runtime/asm_amd64.s:1571 (0xaa3aa0) goexit: BYTE $0x90 // NOP

boahost commented 11 months ago

I have this problem too