(createdAt, createdBy, title, body string)
| 162 | } |
| 163 | |
| 164 | func printStructuredTimelineEntry(createdAt, createdBy, title, body string) { |
| 165 | if title == "" { |
| 166 | return |
| 167 | } |
| 168 | |
| 169 | metaParts := make([]string, 0, 2) |
| 170 | if createdAt != "" { |
| 171 | if ts, err := time.Parse(time.RFC3339, createdAt); err == nil { |
| 172 | metaParts = append(metaParts, cli.RelativeTime(ts)) |
| 173 | } else { |
| 174 | metaParts = append(metaParts, createdAt) |
| 175 | } |
| 176 | } |
| 177 | if createdBy != "" { |
| 178 | metaParts = append(metaParts, createdBy) |
| 179 | } |
| 180 | |
| 181 | fmt.Printf("• %s", title) |
| 182 | if len(metaParts) > 0 { |
| 183 | fmt.Printf(" %s", color.New(color.Faint).Sprint(strings.Join(metaParts, " · "))) |
| 184 | } |
| 185 | fmt.Println() |
| 186 | if body != "" { |
| 187 | fmt.Printf(" %s\n", body) |
| 188 | } |
| 189 | } |
no test coverage detected