1
0
mirror of https://github.com/mgechev/revive.git synced 2025-07-15 01:04:40 +02:00

Lint cleanup (#679)

This commit is contained in:
chavacava
2022-04-10 11:55:13 +02:00
committed by GitHub
parent 31fbdb1833
commit 04728cf0de
83 changed files with 203 additions and 233 deletions

View File

@ -13,8 +13,6 @@ import (
"github.com/mgechev/revive/lint"
)
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 == "_" }
@ -82,10 +80,10 @@ var zeroLiteral = map[string]bool{
"0i": true,
}
func validType(T types.Type) bool {
return T != nil &&
T != types.Typ[types.Invalid] &&
!strings.Contains(T.String(), "invalid type") // good but not foolproof
func validType(t types.Type) bool {
return t != nil &&
t != types.Typ[types.Invalid] &&
!strings.Contains(t.String(), "invalid type") // good but not foolproof
}
// isPkgDot checks if the expression is <pkg>.<name>