MCPcopy Index your code
hub / github.com/coder/coder / taskListRowFromTask

Function taskListRowFromTask

cli/task_list.go:22–33  ·  view source on GitHub ↗
(now time.Time, t codersdk.Task)

Source from the content-addressed store, hash-verified

20}
21
22func 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
35func (r *RootCmd) taskList() *serpent.Command {
36 var (

Callers 1

taskListMethod · 0.85

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected