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:
parent
61222a1967
commit
5ce2ff53c0
@ -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
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user