Skip to content

Commit c2f0aa3

Browse files
committed
Use log package to fix lint error
main.go:139:7: use of `fmt.Printf` forbidden by pattern `^fmt\.Print(|f|ln)$` (forbidigo) fmt.Printf("Skip the repository %v with imageTag %v. %v\n", repo, imageTag, err.Error()) ^
1 parent 137683f commit c2f0aa3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,14 @@ func getECRImageScanFindings(repositories []string) ([]findingsInfo, error) {
136136
if aerr, ok := err.(awserr.Error); ok {
137137
switch aerr.Code() {
138138
case "ScanNotFoundException":
139-
fmt.Printf("Skip the repository %v with imageTag %v. %v\n", repo, imageTag, err.Error())
139+
log.Printf("Skip the repository %v with imageTag %v. %v\n", repo, imageTag, err.Error())
140140
case "ImageNotFoundException":
141-
fmt.Printf("Skip the repository %v with imageTag %v. %v\n", repo, imageTag, err.Error())
141+
log.Printf("Skip the repository %v with imageTag %v. %v\n", repo, imageTag, err.Error())
142142
default:
143143
return nil, fmt.Errorf("failed to describe image scan findings: %w", err)
144144
}
145145
} else if findings.ImageScanFindings == nil {
146-
fmt.Printf("Skip the repository %v with imageTag %v. ImageScanStatus: Status %v Description %v\n", repo, imageTag, findings.ImageScanStatus.Status, findings.ImageScanStatus.Description)
146+
log.Printf("Skip the repository %v with imageTag %v. ImageScanStatus: Status %v Description %v\n", repo, imageTag, findings.ImageScanStatus.Status, findings.ImageScanStatus.Description)
147147
} else {
148148
results = generateFindingsInfos(findings, imageTag, repo)
149149
}

0 commit comments

Comments
 (0)