mirror of
https://github.com/securego/gosec.git
synced 2024-12-25 03:55:54 +00:00
Populate the fixes only when autofix is not empty (#1226)
Change-Id: If4de66d1ea0fd5a179808d023fdac677437c6d5a Signed-off-by: Cosmin Cojocar <ccojocar@google.com>
This commit is contained in:
parent
3004932005
commit
be8bd6e40b
1 changed files with 6 additions and 3 deletions
|
@ -80,20 +80,23 @@ func NewTool(driver *ToolComponent) *Tool {
|
|||
|
||||
// NewResult instantiate a Result
|
||||
func NewResult(ruleID string, ruleIndex int, level Level, message string, suppressions []*Suppression, autofix string) *Result {
|
||||
return &Result{
|
||||
result := &Result{
|
||||
RuleID: ruleID,
|
||||
RuleIndex: ruleIndex,
|
||||
Level: level,
|
||||
Message: NewMessage(message),
|
||||
Suppressions: suppressions,
|
||||
Fixes: []*Fix{
|
||||
}
|
||||
if len(autofix) > 0 {
|
||||
result.Fixes = []*Fix{
|
||||
{
|
||||
Description: &Message{
|
||||
Markdown: autofix,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
// NewMessage instantiate a Message
|
||||
|
|
Loading…
Reference in a new issue