1
0
mirror of https://github.com/mgechev/revive.git synced 2024-11-24 08:32:22 +02:00

removes duplicated utility function (#652)

This commit is contained in:
chavacava 2022-03-18 15:00:41 +01:00 committed by GitHub
parent 61222a1967
commit 5ce2ff53c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 6 deletions

View File

@ -23,7 +23,7 @@ type ExportedRule struct {
func (r *ExportedRule) Apply(file *lint.File, args lint.Arguments) []lint.Failure {
var failures []lint.Failure
if isTest(file) {
if file.IsTest() {
return failures
}

View File

@ -20,7 +20,7 @@ type PackageCommentsRule struct{}
func (r *PackageCommentsRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure {
var failures []lint.Failure
if isTest(file) {
if file.IsTest() {
return failures
}

View File

@ -19,10 +19,6 @@ const styleGuideBase = "https://golang.org/wiki/CodeReviewComments"
// If id == nil, the answer is false.
func isBlank(id *ast.Ident) bool { return id != nil && id.Name == "_" }
func isTest(f *lint.File) bool {
return strings.HasSuffix(f.Name, "_test.go")
}
var commonMethods = map[string]bool{
"Error": true,
"Read": true,