File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,6 @@ func (l *Loader) Next() bool {
73
73
return false
74
74
}
75
75
76
- var vs []claircore.Vulnerability
77
76
for l .err = l .dec .Decode (& l .de ); l .err == nil ; l .err = l .dec .Decode (& l .de ) {
78
77
id := l .de .Ref
79
78
// If we just hit a new Entry, promote the current one.
@@ -84,15 +83,14 @@ func (l *Loader) Next() bool {
84
83
l .next .Fingerprint = l .de .Fingerprint
85
84
l .next .Date = l .de .Date
86
85
}
87
- i := len (vs )
88
86
switch l .de .Kind {
89
87
case driver .VulnerabilityKind :
90
- vs = append ( vs , claircore.Vulnerability {})
91
- if err := json .Unmarshal (l .de .Vuln .buf , & vs [ i ] ); err != nil {
88
+ vuln := claircore.Vulnerability {}
89
+ if err := json .Unmarshal (l .de .Vuln .buf , & vuln ); err != nil {
92
90
l .err = err
93
91
return false
94
92
}
95
- l .next .Vuln = append (l .next .Vuln , & vs [ i ] )
93
+ l .next .Vuln = append (l .next .Vuln , & vuln )
96
94
case driver .EnrichmentKind :
97
95
en := driver.EnrichmentRecord {}
98
96
if err := json .Unmarshal (l .de .Enrichment .buf , & en ); err != nil {
You can’t perform that action at this time.
0 commit comments