lint errors

This commit is contained in:
James Bardin 2017-04-19 18:19:48 -04:00
parent 14bea66f4e
commit 4c3a053f0c
1 changed files with 6 additions and 8 deletions

View File

@ -114,20 +114,19 @@ func (conf *StateChangeConf) WaitForState() (interface{}, error) {
// If we're waiting for the absence of a thing, then return // If we're waiting for the absence of a thing, then return
if res == nil && len(conf.Target) == 0 { if res == nil && len(conf.Target) == 0 {
targetOccurence += 1 targetOccurence++
if conf.ContinuousTargetOccurence == targetOccurence { if conf.ContinuousTargetOccurence == targetOccurence {
result.Done = true result.Done = true
resCh <- result resCh <- result
return return
} else {
continue
} }
continue
} }
if res == nil { if res == nil {
// If we didn't find the resource, check if we have been // If we didn't find the resource, check if we have been
// not finding it for awhile, and if so, report an error. // not finding it for awhile, and if so, report an error.
notfoundTick += 1 notfoundTick++
if notfoundTick > conf.NotFoundChecks { if notfoundTick > conf.NotFoundChecks {
result.Error = &NotFoundError{ result.Error = &NotFoundError{
LastError: err, LastError: err,
@ -144,14 +143,13 @@ func (conf *StateChangeConf) WaitForState() (interface{}, error) {
for _, allowed := range conf.Target { for _, allowed := range conf.Target {
if currentState == allowed { if currentState == allowed {
found = true found = true
targetOccurence += 1 targetOccurence++
if conf.ContinuousTargetOccurence == targetOccurence { if conf.ContinuousTargetOccurence == targetOccurence {
result.Done = true result.Done = true
resCh <- result resCh <- result
return return
} else {
continue
} }
continue
} }
} }
@ -237,7 +235,7 @@ func (conf *StateChangeConf) WaitForState() (interface{}, error) {
} }
if !ok { if !ok {
// the the goroutine returned // the goroutine returned
break forSelect break forSelect
} }