PrintActivityTable prints activity entries in a table.
(activities []models.Activity)
| 651 | |
| 652 | // PrintActivityTable prints activity entries in a table. |
| 653 | func PrintActivityTable(activities []models.Activity) { |
| 654 | if len(activities) == 0 { |
| 655 | fmt.Println("No recent activity.") |
| 656 | return |
| 657 | } |
| 658 | |
| 659 | w := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0) |
| 660 | fmt.Fprintf(w, "ACTION\tACTOR\tSOURCE\tWHEN\n") |
| 661 | for _, a := range activities { |
| 662 | fmt.Fprintf(w, "%s\t%s\t%s\t%s\n", |
| 663 | a.Action, |
| 664 | a.Actor, |
| 665 | a.Source, |
| 666 | RelativeTime(a.CreatedAt), |
| 667 | ) |
| 668 | } |
| 669 | w.Flush() |
| 670 | } |
| 671 | |
| 672 | // PrintCommentTable prints comments in a formatted table. |
| 673 | // PrintCommentTable deliberately does NOT render Comment.AgentName (TASK-2760). |
nothing calls this directly
no test coverage detected