Skip to content

Commit 373b30e

Browse files
committed
ST1003: flag package name, not entire file
1 parent 6383285 commit 373b30e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stylecheck/st1003/st1003.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@ func run(pass *analysis.Pass) (any, error) {
112112
for _, f := range pass.Files {
113113
// Package names need slightly different handling than other names.
114114
if !strings.HasSuffix(f.Name.Name, "_test") && strings.Contains(f.Name.Name, "_") {
115-
report.Report(pass, f, "should not use underscores in package names", report.FilterGenerated())
115+
report.Report(pass, f.Name, "should not use underscores in package names", report.FilterGenerated())
116116
}
117117
if strings.IndexFunc(f.Name.Name, unicode.IsUpper) != -1 {
118-
report.Report(pass, f, fmt.Sprintf("should not use MixedCaps in package name; %s should be %s", f.Name.Name, strings.ToLower(f.Name.Name)), report.FilterGenerated())
118+
report.Report(pass, f.Name, fmt.Sprintf("should not use MixedCaps in package name; %s should be %s", f.Name.Name, strings.ToLower(f.Name.Name)), report.FilterGenerated())
119119
}
120120
}
121121

0 commit comments

Comments
 (0)