From 8a3e92728cb97f60fcacfc0a0beceed112068772 Mon Sep 17 00:00:00 2001 From: iseki Date: Wed, 27 Apr 2022 00:05:05 +0800 Subject: [PATCH] fix: Work-around to keep result consistency. --- cmd/idea_output.go | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/cmd/idea_output.go b/cmd/idea_output.go index efb17172..a68cecba 100644 --- a/cmd/idea_output.go +++ b/cmd/idea_output.go @@ -114,12 +114,17 @@ func generatePluginOutput(ctx *inspector.ScanContext) *PluginOutput { Language: mod.Language, FixType: comp.FixType, } - for _, it := range comp.MinFixedInfo { - p.MinFixed = append(p.MinFixed, PluginCompFix{ - OldVersion: it.OldVersion, - NewVersion: it.NewVersion, - CompName: it.Name, - }) + // Work-around to keep result consistency. + if len(rs[cid].MinFixed) > 0 { + p.MinFixed = rs[cid].MinFixed + } else { + for _, it := range comp.MinFixedInfo { + p.MinFixed = append(p.MinFixed, PluginCompFix{ + OldVersion: it.OldVersion, + NewVersion: it.NewVersion, + CompName: it.Name, + }) + } } if comp.License != nil { p.License = &PluginCompLicense{