default result.severity to info when formatting string

This commit is contained in:
Mengqi Yu
2021-11-19 01:25:03 -08:00
parent 4e7aebc20c
commit 81edfb7ee8

View File

@@ -64,7 +64,12 @@ func (i Result) String() string {
}
}
formatString := "[%s]"
list := []interface{}{i.Severity}
severity := i.Severity
// We default Severity to Info when converting a result to a message.
if i.Severity == "" {
severity = Info
}
list := []interface{}{severity}
if len(idStringList) > 0 {
formatString += " %s"
list = append(list, strings.Join(idStringList, "/"))