feat(report): Change the priority of CVE information in Debian (#1202)
* fix (bug) : using ScanResults refs #1019 * feat(gost): WIP change priority of CVE Info in Debian * feat(report): change priority of CVE Info in Debian * refactor: move RemoveRaspbianPackFromResult * style: remove comment * fix: lint error * style: change coding style * feat(report): support reporting with gost alone * fix: merge error * refactor(debian): change code to be simple
This commit is contained in:
@@ -291,12 +291,11 @@ func (r ScanResult) IsContainer() bool {
|
||||
}
|
||||
|
||||
// RemoveRaspbianPackFromResult is for Raspberry Pi and removes the Raspberry Pi dedicated package from ScanResult.
|
||||
func (r ScanResult) RemoveRaspbianPackFromResult() ScanResult {
|
||||
func (r ScanResult) RemoveRaspbianPackFromResult() *ScanResult {
|
||||
if r.Family != constant.Raspbian {
|
||||
return r
|
||||
return &r
|
||||
}
|
||||
|
||||
result := r
|
||||
packs := make(Packages)
|
||||
for _, pack := range r.Packages {
|
||||
if !IsRaspbianPackage(pack.Name, pack.Version) {
|
||||
@@ -311,10 +310,10 @@ func (r ScanResult) RemoveRaspbianPackFromResult() ScanResult {
|
||||
}
|
||||
}
|
||||
|
||||
result.Packages = packs
|
||||
result.SrcPackages = srcPacks
|
||||
r.Packages = packs
|
||||
r.SrcPackages = srcPacks
|
||||
|
||||
return result
|
||||
return &r
|
||||
}
|
||||
|
||||
// ClearFields clears a given fields of ScanResult
|
||||
|
||||
Reference in New Issue
Block a user