1
0
mirror of https://github.com/mgechev/revive.git synced 2025-04-25 12:04:51 +02:00
revive/defaultrule/utils.go

19 lines
409 B
Go
Raw Normal View History

2017-11-26 18:48:07 -08:00
package defaultrule
import (
2017-11-26 18:58:15 -08:00
"go/ast"
2017-11-26 18:48:07 -08:00
"strings"
"github.com/mgechev/revive/file"
)
2017-11-26 18:58:15 -08:00
const styleGuideBase = "https://golang.org/wiki/CodeReviewComments"
// isBlank returns whether id is the blank identifier "_".
// If id == nil, the answer is false.
func isBlank(id *ast.Ident) bool { return id != nil && id.Name == "_" }
2017-11-26 18:48:07 -08:00
func isTest(f *file.File) bool {
return strings.HasSuffix(f.Name, "_test.go")
}