Skip to content

Commit

Permalink
removes duplicated utility function (#652)
Browse files Browse the repository at this point in the history
  • Loading branch information
chavacava authored Mar 18, 2022
1 parent 61222a1 commit 5ce2ff5
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion rule/exported.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion rule/package-comments.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
4 changes: 0 additions & 4 deletions rule/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 5ce2ff5

Please sign in to comment.