Skip to content

Commit 0daa69a

Browse files
committed
cmd/vulnreport: dedupe excluded labels
Reuse list of excluded labels from the internal/report package. Change-Id: Id895e3f3e1452ae37f56e20d66fad057b03f837f Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/515396 TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Damien Neil <[email protected]> Run-TryBot: Tatiana Bradley <[email protected]>
1 parent ccf7526 commit 0daa69a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

cmd/vulnreport/main.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,15 +391,13 @@ func writeReport(r *report.Report) (string, error) {
391391

392392
func createExcluded(ctx context.Context, cfg *createCfg) (err error) {
393393
defer derrors.Wrap(&err, "createExcluded()")
394-
excludedLabels := []string{"excluded: DEPENDENT_VULNERABILITY",
395-
"excluded: EFFECTIVELY_PRIVATE", "excluded: NOT_A_VULNERABILITY",
396-
"excluded: NOT_GO_CODE", "excluded: NOT_IMPORTABLE"}
397394
isses := []*issues.Issue{}
398395
stateOption := "open"
399396
if cfg.allowClosed {
400397
stateOption = "all"
401398
}
402-
for _, label := range excludedLabels {
399+
for _, er := range report.ExcludedReasons {
400+
label := fmt.Sprintf("excluded: %s", er)
403401
tempIssues, err :=
404402
cfg.issuesClient.Issues(ctx, issues.IssuesOptions{Labels: []string{label}, State: stateOption})
405403
if err != nil {

0 commit comments

Comments
 (0)