go-jarvis / rum-gonic

a gin based RESTful web framework, inspired by cobra
MIT License
0 stars 0 forks source link

`gin.Context.Keys=map[string]interface` use `string` as key, golang-lint checks then return an errror #11

Open tangx opened 2 years ago

tangx commented 2 years ago
internal/demo-test/gin-demo/main.go:41:31: SA1029: should not use built-in type string as key for value; define your own type to avoid collisions (staticcheck)
        ctx = context.WithValue(ctx, "alibaba", "alimama")
                                     ^
internal/demo-test/reflect-type-name/main.go:33:6: `IPerson` is unused (deadcode)
type IPerson interface {
     ^
rum/context_injector.go:31:33: SA1029: should not use built-in type string as key for value; define your own type to avoid collisions (staticcheck)
                return context.WithValue(ctx, _key, value)
                                              ^