diff --git a/rule/confusing-naming.go b/rule/confusing-naming.go index 8b1c3eac4..daaf51c81 100644 --- a/rule/confusing-naming.go +++ b/rule/confusing-naming.go @@ -71,7 +71,6 @@ func (*ConfusingNamingRule) Name() string { // checkMethodName checks if a given method/function name is similar (just case differences) to other method/function of the same struct/file. func checkMethodName(holder string, id *ast.Ident, w *lintConfusingNames) { - if id.Name == "init" && holder == defaultStructName { // ignore init functions return diff --git a/rule/defer.go b/rule/defer.go index f3ea17920..31c54b471 100644 --- a/rule/defer.go +++ b/rule/defer.go @@ -144,8 +144,8 @@ func (w lintDeferRule) Visit(node ast.Node) ast.Visitor { w.newFailure("be careful when deferring calls to methods without pointer receiver", fn, 0.8, "bad practice", "method-call") } } - } + return nil }