Fix simple mistakes identified by goreportcard.

These are primarily simplification and lint mistakes. However, minor
fixes are also included and tests added where appropriate.

PiperOrigin-RevId: 351425971
This commit is contained in:
Adin Scannell
2021-01-12 12:38:22 -08:00
committed by gVisor bot
parent cc5df09373
commit 0dab30d83f
63 changed files with 293 additions and 201 deletions
+2 -2
View File
@@ -84,7 +84,7 @@ func (p *FindingsPoster) Walk(paths []string) error {
func (p *FindingsPoster) Post() error {
// Just show results?
if p.dryRun {
for finding, _ := range p.findings {
for finding := range p.findings {
// Pretty print, so that this is useful for debugging.
fmt.Printf("%s: (%s+%d) %s\n", finding.Category, finding.Position.Filename, finding.Position.Line, finding.Message)
}
@@ -114,7 +114,7 @@ func (p *FindingsPoster) Post() error {
},
}
annotationLevel := "failure" // Always.
for finding, _ := range p.findings {
for finding := range p.findings {
title := string(finding.Category)
opts.Output.Annotations = append(opts.Output.Annotations, &github.CheckRunAnnotation{
Path: &finding.Position.Filename,