Improve detailed QEntry String representation

This commit is contained in:
Jan Philipp Timme 2018-12-30 13:23:30 +01:00
parent 73fd1dcf8e
commit 1c8a2a0924
1 changed files with 5 additions and 1 deletions

View File

@ -36,7 +36,11 @@ func (m QEntry) String() string {
}
func (m QEntry) DetailedString() string {
return fmt.Sprintf("Id: %s\nDate: %s\nStatus: %s\nReason: %s\nSize: %d\nSender: %s\nRecipients: %s", m.id, m.date.Format(sortableDateFormat), m.status, m.reason, m.size, m.sender, strings.Join(m.recipients, ", "))
var reasonStr string
if m.reason == "" {
reasonStr = "-/-"
}
return fmt.Sprintf("Id: %s\nDate: %s\nStatus: %s\nReason: %s\nSize: %d\nSender: %s\nRecipients: %s", m.id, m.date.Format(sortableDateFormat), m.status, reasonStr, m.size, m.sender, strings.Join(m.recipients, ", "))
}
func ParseMailQ(dataSource io.Reader) ([]QEntry, error) {