Skip to content

add varnamelen linter #2240

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Oct 27, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
review: use std import in the linter test.
  • Loading branch information
ldez committed Sep 26, 2021
commit f96a1108f8eaa94c5ef2804d681449d39a4615fc
4 changes: 3 additions & 1 deletion test/testdata/varnamelen.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
//args: -Evarnamelen
package testdata

import "math"

func varnamelen() {
x := 1 // ERROR "variable name 'x' is too short for the scope of its usage"
x := math.MinInt8 // ERROR "variable name 'x' is too short for the scope of its usage"
x++
x++
x++
Expand Down