-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A big change for bean , add gzip middleware #135
Conversation
2. add compress middle ware
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
golangci
app/start.go|176 col 40| Skipper, HSTSExcludeSubdomains, CSPReportOnly, HSTSPreloadEnabled, ReferrerPolicy are missing in SecureConfig (exhaustivestruct)
app/start.go|190 col 22| Skipper, AccessLogFormat, BodyDumpFormat, CustomTimeFormat, Output, MaskedParameters are missing in LoggerConfig (exhaustivestruct)
app/start.go|222 col 24| WaitForDelivery is missing in Options (exhaustivestruct)
app/start.go|241 col 43| Skipper, RequestIDHandler, TargetHeader are missing in RequestIDConfig (exhaustivestruct)
bean.go|167 col 7| pool, DBConn, BeforeServe, errorHandlerFuncs are missing in Bean (exhaustivestruct)
bean.go|181 col 10| mu, binder, validator, query, bean are missing in beanContext (exhaustivestruct)
middleware/compress.go|81 col 13| wroteBody is missing in gzipResponseWriter (exhaustivestruct)
middleware/compress_test.go|152 col 47| Skipper is missing in GzipConfig (exhaustivestruct)
app/start.go|37 col 5| BeanConfig is a global variable (gochecknoglobals)
bean.go|151 col 5| BeanLogger is a global variable (gochecknoglobals)
bean.go|156 col 5| TenantAlterDbHostParam is a global variable (gochecknoglobals)
middleware/compress.go|40 col 2| DefaultGzipConfig is a global variable (gochecknoglobals)
middleware/compress_test.go|139 col 10| err113: do not define dynamic errors, use wrapped static errors instead: "errors.New(http.StatusText(http.StatusNotFound))" (goerr113)
app/start.go|62 col 57| mnd: Magic number: 5, in detected (gomnd)
middleware/middleware.go|27 col 28| mnd: Magic number: 2, in detected (gomnd)
middleware/middleware.go|29 col 8| mnd: Magic number: 2, in detected (gomnd)
middleware/compress_test.go|102 col 2| variable 'bc' is only used in the if-statement (middleware/compress_test.go:107:2); consider using short syntax (ifshort)
middleware/compress_test.go|119 col 2| variable 'bc' is only used in the if-statement (middleware/compress_test.go:123:2); consider using short syntax (ifshort)
bean.go|159 col 1| Logger returns interface (github.com/labstack/echo/v4.Logger) (ireturn)
app/start.go|66 col 17| named return "conn" with type "net.Conn" found (nonamedreturns)
context.go|433 col 1| named return "err" with type "error" found (nonamedreturns)
middleware/compress_test.go|97 col 1| Function TestGzipNoContent missing the call to method parallel (paralleltest)
middleware/compress_test.go|114 col 1| Function TestGzipEmpty missing the call to method parallel (paralleltest)
middleware/compress_test.go|135 col 1| Function TestGzipErrorReturned missing the call to method parallel (paralleltest)
middleware/compress_test.go|149 col 1| Function TestGzipErrorReturnedInvalidConfig missing the call to method parallel (paralleltest)
middleware/compress_test.go|166 col 1| Function TestGzipWithStatic missing the call to method parallel (paralleltest)
middleware/compress_test.go|1 col 9| package should be middleware_test
instead of middleware
(testpackage)
app/start.go|130 col 2| variable name 'e' is too short for the scope of its usage (varnamelen)
app/start.go|100 col 69| parameter name 'c' is too short for the scope of its usage (varnamelen)
async/async.go|129 col 19| parameter name 'r' is too short for the scope of its usage (varnamelen)
middleware/compress_test.go|200 col 2| variable name 'h' is too short for the scope of its usage (varnamelen)
middleware/compress_test.go|25 col 2| variable name 'h' is too short for the scope of its usage (varnamelen)
app/start.go|70 col 18| error returned from external package is unwrapped: sig: func (*github.com/rs/dnscache.Resolver).LookupHost(ctx context.Context, host string) (addrs []string, err error) (wrapcheck)
app/start.go|105 col 13| error returned from interface method should be wrapped: sig: func (github.com/labstack/echo/v4.Context).JSON(code int, i interface{}) error (wrapcheck)
app/start.go|113 col 12| error returned from external package is unwrapped: sig: func (*github.com/dgraph-io/badger/v3.Txn).Delete(key []byte) error (wrapcheck)
app/start.go|116 col 12| error returned from interface method should be wrapped: sig: func (github.com/labstack/echo/v4.Context).JSON(code int, i interface{}) error (wrapcheck)
app/start.go|121 col 11| error returned from interface method should be wrapped: sig: func (github.com/labstack/echo/v4.Context).JSON(code int, i interface{}) error (wrapcheck)
app/start.go|287 col 17| error returned from external package is unwrapped: sig: func os.MkdirAll(path string, perm io/fs.FileMode) error (wrapcheck)
app/start.go|290 col 16| error returned from external package is unwrapped: sig: func os.Stat(name string) (io/fs.FileInfo, error) (wrapcheck)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
golangci
bean.go|159 col 1| Logger returns interface (github.com/labstack/echo/v4.Logger) (ireturn)
app/start.go|66 col 17| named return "conn" with type "net.Conn" found (nonamedreturns)
bean.go|163 col 1| named return "b" with type "*Bean" found (nonamedreturns)
context.go|433 col 1| named return "err" with type "error" found (nonamedreturns)
middleware/compress_test.go|18 col 1| Function TestGzip missing the call to method parallel (paralleltest)
middleware/compress_test.go|97 col 1| Function TestGzipNoContent missing the call to method parallel (paralleltest)
middleware/compress_test.go|114 col 1| Function TestGzipEmpty missing the call to method parallel (paralleltest)
middleware/compress_test.go|135 col 1| Function TestGzipErrorReturned missing the call to method parallel (paralleltest)
middleware/compress_test.go|149 col 1| Function TestGzipErrorReturnedInvalidConfig missing the call to method parallel (paralleltest)
middleware/compress_test.go|166 col 1| Function TestGzipWithStatic missing the call to method parallel (paralleltest)
middleware/compress_test.go|1 col 9| package should be middleware_test
instead of middleware
(testpackage)
app/start.go|130 col 2| variable name 'e' is too short for the scope of its usage (varnamelen)
async/async.go|129 col 19| parameter name 'r' is too short for the scope of its usage (varnamelen)
app/start.go|70 col 18| error returned from external package is unwrapped: sig: func (*github.com/rs/dnscache.Resolver).LookupHost(ctx context.Context, host string) (addrs []string, err error) (wrapcheck)
app/start.go|105 col 13| error returned from interface method should be wrapped: sig: func (github.com/labstack/echo/v4.Context).JSON(code int, i interface{}) error (wrapcheck)
app/start.go|113 col 12| error returned from external package is unwrapped: sig: func (*github.com/dgraph-io/badger/v3.Txn).Delete(key []byte) error (wrapcheck)
app/start.go|116 col 12| error returned from interface method should be wrapped: sig: func (github.com/labstack/echo/v4.Context).JSON(code int, i interface{}) error (wrapcheck)
app/start.go|121 col 11| error returned from interface method should be wrapped: sig: func (github.com/labstack/echo/v4.Context).JSON(code int, i interface{}) error (wrapcheck)
app/start.go|287 col 17| error returned from external package is unwrapped: sig: func os.MkdirAll(path string, perm io/fs.FileMode) error (wrapcheck)
app/start.go|290 col 16| error returned from external package is unwrapped: sig: func os.Stat(name string) (io/fs.FileInfo, error) (wrapcheck)
28dc45f
to
2720328
Compare
improve reviewdog improve reviewdog improve reviewdog
…inc/bean into 2.x/compress-middleware
No description provided.