Skip to content

Commit

Permalink
lint: fix st shadowing
Browse files Browse the repository at this point in the history
  • Loading branch information
umputun committed May 2, 2023
1 parent 461ae52 commit ef21c42
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func (p *Process) runTaskOnHost(ctx context.Context, tsk *config.Task, hostAddr,
}
return false
}
st := time.Now()
stTask := time.Now()
remote, err := p.Connector.Connect(ctx, hostAddr, hostName, user)
if err != nil {
return 0, fmt.Errorf("can't connect to %s: %w", hostAddr, err)
Expand All @@ -130,7 +130,7 @@ func (p *Process) runTaskOnHost(ctx context.Context, tsk *config.Task, hostAddr,
}

log.Printf("[INFO] run command %q on host %q (%s)", cmd.Name, hostAddr, hostName)
st := time.Now()
stCmd := time.Now()
params := execCmdParams{cmd: cmd, hostAddr: hostAddr, tsk: tsk, exec: remote}
if cmd.Options.Local {
params.exec = &executor.Local{}
Expand All @@ -142,18 +142,18 @@ func (p *Process) runTaskOnHost(ctx context.Context, tsk *config.Task, hostAddr,
return count, fmt.Errorf("failed command %q on host %s (%s): %w", cmd.Name, hostAddr, hostName, err)
}

fmt.Fprintf(p.ColorWriter.WithHost(hostAddr, hostName), "failed %s%s (%v)",
cmd.Name, details, time.Since(st).Truncate(time.Millisecond))
fmt.Fprintf(p.ColorWriter.WithHost(hostAddr, hostName), "failed command %s%s (%v)",
cmd.Name, details, time.Since(stCmd).Truncate(time.Millisecond))
continue
}

fmt.Fprintf(p.ColorWriter.WithHost(hostAddr, hostName),
"completed command %q%s (%v)", cmd.Name, details, time.Since(st).Truncate(time.Millisecond))
"completed command %q%s (%v)", cmd.Name, details, time.Since(stCmd).Truncate(time.Millisecond))
count++
}

fmt.Fprintf(p.ColorWriter.WithHost(hostAddr, hostName),
"completed task %q, commands: %d (%v)\n", tsk.Name, count, time.Since(st).Truncate(time.Millisecond))
"completed task %q, commands: %d (%v)\n", tsk.Name, count, time.Since(stTask).Truncate(time.Millisecond))

return count, nil
}
Expand Down

0 comments on commit ef21c42

Please sign in to comment.