Skip to content

Commit

Permalink
Make minor linter improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
nkryuchkov committed Dec 26, 2019
1 parent 2756ecc commit 0dc3a76
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pkg/restart/restart.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ const (
// Context describes data required for restarting visor.
type Context struct {
log logrus.FieldLogger
isStarting int32
cmd *exec.Cmd
checkDelay time.Duration
isStarting int32
appendDelay bool // disabled in tests
cmd *exec.Cmd
}

// CaptureContext captures data required for restarting visor.
Expand Down Expand Up @@ -114,12 +114,15 @@ func (c *Context) startExec() chan error {
func (c *Context) adjustArgs() {
args := c.cmd.Args

i := 0
l := len(args)
for i := 0; i < l; i++ {

for i < l {
if args[i] == delayArgName && i < len(args)-1 {
args = append(args[:i], args[i+2:]...)
i--
l -= 2
} else {
i++
}
}

Expand Down

0 comments on commit 0dc3a76

Please sign in to comment.