Skip to content

Commit

Permalink
Do not add a "|" to output if there is no perfdata
Browse files Browse the repository at this point in the history
  • Loading branch information
Lorenz Kästle committed Oct 15, 2022
1 parent 6ca0559 commit d5dae97
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion result/overall.go
Expand Up @@ -33,7 +33,11 @@ type PartialResult struct {
}

func (s *PartialResult) String() string {
return fmt.Sprintf("[%s] %s|%s", check.StatusText(s.State), s.Output, s.Perfdata.String())
if len(s.Perfdata) == 0 {
return fmt.Sprintf("[%s] %s", check.StatusText(s.State), s.Output)
} else {
return fmt.Sprintf("[%s] %s|%s", check.StatusText(s.State), s.Output, s.Perfdata.String())
}
}

// Deprecate this in a future version
Expand Down

0 comments on commit d5dae97

Please sign in to comment.