Skip to content

Commit

Permalink
Move "found" line to reduce if count
Browse files Browse the repository at this point in the history
Tom Parker committed Apr 25, 2017
1 parent 8638605 commit 33cbbdf
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions main.go
Original file line number Diff line number Diff line change
@@ -97,16 +97,14 @@ func main() {
c := clair.NewClair(clairAddr)
vs := c.Analyse(image)
groupBySeverity(vs)
if !useJSONOutput {
fmt.Printf("Found %d vulnerabilities \n", len(vs))
}
highSevNumber := len(store["High"]) + len(store["Critical"]) + len(store["Defcon1"])

if useJSONOutput {
output.Vulnerabilities = vs
enc := json.NewEncoder(os.Stdout)
enc.Encode(output)
} else {
fmt.Printf("Found %d vulnerabilities \n", len(vs))
iteratePriorities(clairOutput, func(sev string) {
for _, v := range store[sev] {
fmt.Printf("%s: [%s] \n%s\n%s\n", v.Name, v.Severity, v.Description, v.Link)

0 comments on commit 33cbbdf

Please sign in to comment.