From 0dc3a763ad3ae9a445e4c0c0d1cf757278f3c891 Mon Sep 17 00:00:00 2001 From: Nikita Kryuchkov Date: Thu, 26 Dec 2019 22:43:39 +0400 Subject: [PATCH] Make minor linter improvements --- pkg/restart/restart.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkg/restart/restart.go b/pkg/restart/restart.go index f108cc16de..0c485ebb8d 100644 --- a/pkg/restart/restart.go +++ b/pkg/restart/restart.go @@ -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. @@ -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++ } }