mirror of
https://github.com/mgechev/revive.git
synced 2025-03-17 20:57:58 +02:00
This commit is contained in:
parent
16871ed55f
commit
19a95d9a7f
@ -141,15 +141,6 @@ func (w *lintNames) check(id *ast.Ident, thing string) {
|
||||
})
|
||||
return
|
||||
}
|
||||
if len(id.Name) > 2 && id.Name[0] == 'k' && id.Name[1] >= 'A' && id.Name[1] <= 'Z' {
|
||||
should := string(id.Name[1]+'a'-'A') + id.Name[2:]
|
||||
w.onFailure(lint.Failure{
|
||||
Failure: fmt.Sprintf("don't use leading k in Go names; %s %s should be %s", thing, id.Name, should),
|
||||
Confidence: 0.8,
|
||||
Node: id,
|
||||
Category: "naming",
|
||||
})
|
||||
}
|
||||
|
||||
should := lint.Name(id.Name, w.whitelist, w.blacklist)
|
||||
if id.Name == should {
|
||||
|
3
testdata/golint/var-naming.go
vendored
3
testdata/golint/var-naming.go
vendored
@ -57,8 +57,7 @@ func f_it() { // MATCH /don't use underscores in Go names; func f_it should be f
|
||||
|
||||
// Common styles in other languages that don't belong in Go.
|
||||
const (
|
||||
CPP_CONST = 1 // MATCH /don't use ALL_CAPS in Go names; use CamelCase/
|
||||
kLeadingKay = 2 // MATCH /don't use leading k in Go names; const kLeadingKay should be leadingKay/
|
||||
CPP_CONST = 1 // MATCH /don't use ALL_CAPS in Go names; use CamelCase/
|
||||
|
||||
HTML = 3 // okay; no underscore
|
||||
X509B = 4 // ditto
|
||||
|
Loading…
x
Reference in New Issue
Block a user