From 4c3a053f0cf59ac9d7ab15cbcfbee50f788fde55 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Wed, 19 Apr 2017 18:19:48 -0400 Subject: [PATCH] lint errors --- helper/resource/state.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/helper/resource/state.go b/helper/resource/state.go index 285926b11..37c586a11 100644 --- a/helper/resource/state.go +++ b/helper/resource/state.go @@ -114,20 +114,19 @@ func (conf *StateChangeConf) WaitForState() (interface{}, error) { // If we're waiting for the absence of a thing, then return if res == nil && len(conf.Target) == 0 { - targetOccurence += 1 + targetOccurence++ if conf.ContinuousTargetOccurence == targetOccurence { result.Done = true resCh <- result return - } else { - continue } + continue } if res == nil { // If we didn't find the resource, check if we have been // not finding it for awhile, and if so, report an error. - notfoundTick += 1 + notfoundTick++ if notfoundTick > conf.NotFoundChecks { result.Error = &NotFoundError{ LastError: err, @@ -144,14 +143,13 @@ func (conf *StateChangeConf) WaitForState() (interface{}, error) { for _, allowed := range conf.Target { if currentState == allowed { found = true - targetOccurence += 1 + targetOccurence++ if conf.ContinuousTargetOccurence == targetOccurence { result.Done = true resCh <- result return - } else { - continue } + continue } } @@ -237,7 +235,7 @@ func (conf *StateChangeConf) WaitForState() (interface{}, error) { } if !ok { - // the the goroutine returned + // the goroutine returned break forSelect }