Skip to content

Commit

Permalink
Address some code review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
preetapan committed Oct 31, 2017
1 parent cc83fee commit 3b7090e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions command/alloc_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,8 @@ func (c *AllocStatusCommand) outputTaskStatus(state *api.TaskState) {
for i, event := range state.Events {
if event.DisplayMessage != "" {
formattedTime := formatUnixNanoTime(event.Time)
events[size-i] = fmt.Sprintf("%s|%s|%s", formattedTime, event.Type, event.DisplayMessage)
formattedDisplayMsg := fmt.Sprintf("%s|%s|%s", formattedTime, event.Type, event.DisplayMessage)
events[size-i] = formattedDisplayMsg
} else {
events[size-i] = buildDisplayMessage(event)
}
Expand All @@ -336,7 +337,7 @@ func (c *AllocStatusCommand) outputTaskStatus(state *api.TaskState) {
}

func buildDisplayMessage(event *api.TaskEvent) string {
formatedTime := formatUnixNanoTime(event.Time)
formattedTime := formatUnixNanoTime(event.Time)

// Build up the description based on the event type.
var desc string
Expand Down Expand Up @@ -447,7 +448,7 @@ func buildDisplayMessage(event *api.TaskEvent) string {
}

// Reverse order so we are sorted by time
return fmt.Sprintf("%s|%s|%s", formatedTime, event.Type, desc)
return fmt.Sprintf("%s|%s|%s", formattedTime, event.Type, desc)
}

// outputTaskResources prints the task resources for the passed task and if
Expand Down

0 comments on commit 3b7090e

Please sign in to comment.