diff --git a/revivelib/core_internal_test.go b/revivelib/core_internal_test.go index 9c4ff877e..3de76435d 100644 --- a/revivelib/core_internal_test.go +++ b/revivelib/core_internal_test.go @@ -43,7 +43,7 @@ func (*mockRule) Name() string { return "mock-rule" } -func (*mockRule) Apply(file *lint.File, arguments lint.Arguments) []lint.Failure { +func (*mockRule) Apply(_ *lint.File, _ lint.Arguments) []lint.Failure { return nil } diff --git a/rule/add-constant.go b/rule/add-constant.go index 36a7003da..adbbbd6ba 100644 --- a/rule/add-constant.go +++ b/rule/add-constant.go @@ -105,7 +105,7 @@ func (w lintAddConstantRule) checkFunc(expr *ast.CallExpr) { } } -func (w lintAddConstantRule) getFuncName(expr *ast.CallExpr) string { +func (lintAddConstantRule) getFuncName(expr *ast.CallExpr) string { switch f := expr.Fun.(type) { case *ast.SelectorExpr: switch prefix := f.X.(type) { diff --git a/rule/constant-logical-expr.go b/rule/constant-logical-expr.go index 9abc95d67..36cd641f7 100644 --- a/rule/constant-logical-expr.go +++ b/rule/constant-logical-expr.go @@ -11,7 +11,7 @@ import ( type ConstantLogicalExprRule struct{} // Apply applies the rule to given file. -func (r *ConstantLogicalExprRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure { +func (*ConstantLogicalExprRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure { var failures []lint.Failure onFailure := func(failure lint.Failure) { @@ -63,7 +63,7 @@ func (w *lintConstantLogicalExpr) Visit(node ast.Node) ast.Visitor { return w } -func (w *lintConstantLogicalExpr) isOperatorWithLogicalResult(t token.Token) bool { +func (*lintConstantLogicalExpr) isOperatorWithLogicalResult(t token.Token) bool { switch t { case token.LAND, token.LOR, token.EQL, token.LSS, token.GTR, token.NEQ, token.LEQ, token.GEQ: return true @@ -72,7 +72,7 @@ func (w *lintConstantLogicalExpr) isOperatorWithLogicalResult(t token.Token) boo return false } -func (w *lintConstantLogicalExpr) isEqualityOperator(t token.Token) bool { +func (*lintConstantLogicalExpr) isEqualityOperator(t token.Token) bool { switch t { case token.EQL, token.LEQ, token.GEQ: return true @@ -81,7 +81,7 @@ func (w *lintConstantLogicalExpr) isEqualityOperator(t token.Token) bool { return false } -func (w *lintConstantLogicalExpr) isInequalityOperator(t token.Token) bool { +func (*lintConstantLogicalExpr) isInequalityOperator(t token.Token) bool { switch t { case token.LSS, token.GTR, token.NEQ: return true diff --git a/rule/datarace.go b/rule/datarace.go index 26fcadcdc..c8754ea65 100644 --- a/rule/datarace.go +++ b/rule/datarace.go @@ -53,7 +53,7 @@ func (w lintDataRaces) Visit(n ast.Node) ast.Visitor { return nil } -func (w lintDataRaces) ExtractReturnIDs(fields []*ast.Field) map[*ast.Object]struct{} { +func (lintDataRaces) ExtractReturnIDs(fields []*ast.Field) map[*ast.Object]struct{} { r := map[*ast.Object]struct{}{} for _, f := range fields { for _, id := range f.Names { diff --git a/rule/early-return.go b/rule/early-return.go index 90a0acc55..9c04a1dbe 100644 --- a/rule/early-return.go +++ b/rule/early-return.go @@ -22,7 +22,7 @@ func (*EarlyReturnRule) Name() string { } // CheckIfElse evaluates the rule against an ifelse.Chain. -func (e *EarlyReturnRule) CheckIfElse(chain ifelse.Chain, args ifelse.Args) (failMsg string) { +func (*EarlyReturnRule) CheckIfElse(chain ifelse.Chain, args ifelse.Args) (failMsg string) { if !chain.Else.Deviates() { // this rule only applies if the else-block deviates control flow return diff --git a/rule/enforce-map-style.go b/rule/enforce-map-style.go index ae27b654f..d584434ce 100644 --- a/rule/enforce-map-style.go +++ b/rule/enforce-map-style.go @@ -141,7 +141,7 @@ func (r *EnforceMapStyleRule) Apply(file *lint.File, arguments lint.Arguments) [ } // Name returns the rule name. -func (r *EnforceMapStyleRule) Name() string { +func (*EnforceMapStyleRule) Name() string { return "enforce-map-style" } diff --git a/rule/enforce-slice-style.go b/rule/enforce-slice-style.go index b3611d51a..abaf20be0 100644 --- a/rule/enforce-slice-style.go +++ b/rule/enforce-slice-style.go @@ -165,7 +165,7 @@ func (r *EnforceSliceStyleRule) Apply(file *lint.File, arguments lint.Arguments) } // Name returns the rule name. -func (r *EnforceSliceStyleRule) Name() string { +func (*EnforceSliceStyleRule) Name() string { return "enforce-slice-style" } diff --git a/rule/indent-error-flow.go b/rule/indent-error-flow.go index b80e6486c..294ceef84 100644 --- a/rule/indent-error-flow.go +++ b/rule/indent-error-flow.go @@ -19,7 +19,7 @@ func (*IndentErrorFlowRule) Name() string { } // CheckIfElse evaluates the rule against an ifelse.Chain. -func (e *IndentErrorFlowRule) CheckIfElse(chain ifelse.Chain, args ifelse.Args) (failMsg string) { +func (*IndentErrorFlowRule) CheckIfElse(chain ifelse.Chain, args ifelse.Args) (failMsg string) { if !chain.If.Deviates() { // this rule only applies if the if-block deviates control flow return diff --git a/rule/superfluous-else.go b/rule/superfluous-else.go index 1ef67bf1a..2aa1b6b2c 100644 --- a/rule/superfluous-else.go +++ b/rule/superfluous-else.go @@ -20,7 +20,7 @@ func (*SuperfluousElseRule) Name() string { } // CheckIfElse evaluates the rule against an ifelse.Chain. -func (e *SuperfluousElseRule) CheckIfElse(chain ifelse.Chain, args ifelse.Args) (failMsg string) { +func (*SuperfluousElseRule) CheckIfElse(chain ifelse.Chain, args ifelse.Args) (failMsg string) { if !chain.If.Deviates() { // this rule only applies if the if-block deviates control flow return