handle zero value

This commit is contained in:
Lukas Wurzinger 2024-12-15 07:43:29 +00:00
parent aacd3c2d92
commit 9d2be1a960

View file

@ -144,6 +144,7 @@ const (
ModeCGO
ModeVCS
ModeMultiline
ModeNamed
)
func (b Binfo) Summarize(program string, mode SummaryMode) string {
@ -193,5 +194,11 @@ func (b Binfo) Summarize(program string, mode SummaryMode) string {
)
}
return fmt.Sprintf("%s:%s%s", program, sep, strings.Join(parts, sep))
j := strings.Join(parts, sep)
if program == "" {
return j
} else {
return fmt.Sprintf("%s:%s%s", program, sep, j)
}
}