Skip to content

Commit 5ce2ff5

Browse files
authored
removes duplicated utility function (#652)
1 parent 61222a1 commit 5ce2ff5

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

rule/exported.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type ExportedRule struct {
2323
func (r *ExportedRule) Apply(file *lint.File, args lint.Arguments) []lint.Failure {
2424
var failures []lint.Failure
2525

26-
if isTest(file) {
26+
if file.IsTest() {
2727
return failures
2828
}
2929

rule/package-comments.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ type PackageCommentsRule struct{}
2020
func (r *PackageCommentsRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure {
2121
var failures []lint.Failure
2222

23-
if isTest(file) {
23+
if file.IsTest() {
2424
return failures
2525
}
2626

rule/utils.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ const styleGuideBase = "https://golang.org/wiki/CodeReviewComments"
1919
// If id == nil, the answer is false.
2020
func isBlank(id *ast.Ident) bool { return id != nil && id.Name == "_" }
2121

22-
func isTest(f *lint.File) bool {
23-
return strings.HasSuffix(f.Name, "_test.go")
24-
}
25-
2622
var commonMethods = map[string]bool{
2723
"Error": true,
2824
"Read": true,

0 commit comments

Comments
 (0)