Format formats the messages into a single string
()
| 70 | |
| 71 | // Format formats the messages into a single string |
| 72 | func (m Messages) Format() string { |
| 73 | msgs := []string{} |
| 74 | for _, m := range m { |
| 75 | if msg := m.getMessage(); msg != "" { |
| 76 | msgs = append(msgs, msg) |
| 77 | } |
| 78 | } |
| 79 | return strings.Join(msgs, "\ncaused by: ") |
| 80 | } |
| 81 | |
| 82 | // Get gets the main (top-level) (or first non-empty message if exists) message of the Messages |
| 83 | func (m Messages) Get() string { |