Function
taskListRowFromTask
(now time.Time, t codersdk.Task)
Source from the content-addressed store, hash-verified
| 20 | } |
| 21 | |
| 22 | func taskListRowFromTask(now time.Time, t codersdk.Task) taskListRow { |
| 23 | var stateAgo string |
| 24 | if t.CurrentState != nil { |
| 25 | stateAgo = now.UTC().Sub(t.CurrentState.Timestamp).Truncate(time.Second).String() + " ago" |
| 26 | } |
| 27 | |
| 28 | return taskListRow{ |
| 29 | Task: t, |
| 30 | |
| 31 | StateChangedAgo: stateAgo, |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | func (r *RootCmd) taskList() *serpent.Command { |
| 36 | var ( |
Tested by
no test coverage detected