mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 20:36:12 +02:00
CI/lint: enable some "revive" rules (#3041)
argument-limit Warns when a function receives more parameters than the maximum set by the rule's configuration. bare-return Warns on bare (a.k.a. naked) returns context-as-argument By convention, context.Context should be the first parameter of a function. duplicated-imports It is possible to unintentionally import the same package twice. modifies-parameter A function that modifies its parameters can be hard to understand. It can also be misleading if the arguments are passed by value by the caller. redundant-import-alias This rule warns on redundant import aliases. unreachable-code This rule spots and proposes to remove unreachable code.
This commit is contained in:
parent
8501f459c3
commit
89d02e9458
9 changed files with 17 additions and 24 deletions
|
@ -12,7 +12,6 @@ import (
|
|||
"regexp"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/sirupsen/logrus"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
|
@ -276,7 +275,7 @@ func (r *ReqDumpFilter) ToJSON() error {
|
|||
}
|
||||
|
||||
// Generate a ParsedRequest from a http.Request. ParsedRequest can be consumed by the App security Engine
|
||||
func NewParsedRequestFromRequest(r *http.Request, logger *logrus.Entry) (ParsedRequest, error) {
|
||||
func NewParsedRequestFromRequest(r *http.Request, logger *log.Entry) (ParsedRequest, error) {
|
||||
var err error
|
||||
contentLength := r.ContentLength
|
||||
if contentLength < 0 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue