linter: couple fixes

This commit is contained in:
Zach Ramsay
2017-10-03 12:18:21 -04:00
parent 2681f32bdd
commit cf49ba876f
5 changed files with 18 additions and 27 deletions

View File

@ -140,18 +140,16 @@ func (bs *BaseService) OnStop() {}
// Implements Service
func (bs *BaseService) Reset() (bool, error) {
if atomic.CompareAndSwapUint32(&bs.stopped, 1, 0) {
// whether or not we've started, we can reset
atomic.CompareAndSwapUint32(&bs.started, 1, 0)
bs.Quit = make(chan struct{})
return true, bs.impl.OnReset()
} else {
if stopped := atomic.CompareAndSwapUint32(&bs.stopped, 1, 0); !stopped {
bs.Logger.Debug(Fmt("Can't reset %v. Not stopped", bs.name), "impl", bs.impl)
return false, nil
}
// never happens
return false, nil // nolint: vet
// whether or not we've started, we can reset
atomic.CompareAndSwapUint32(&bs.started, 1, 0)
bs.Quit = make(chan struct{})
return true, bs.impl.OnReset()
}
// Implements Service