Improve detailed QEntry String representation
This commit is contained in:
parent
73fd1dcf8e
commit
1c8a2a0924
@ -36,7 +36,11 @@ func (m QEntry) String() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m QEntry) DetailedString() 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) {
|
func ParseMailQ(dataSource io.Reader) ([]QEntry, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user