diff --git a/suture_simple_test.go b/suture_simple_test.go index 718e729..9afda11 100644 --- a/suture_simple_test.go +++ b/suture_simple_test.go @@ -17,7 +17,7 @@ func (i *Incrementor) Serve() { for { select { case i.next <- i.current: - i.current += 1 + i.current++ case <-i.stop: // We sync here just to guarantee the output of "Stopping the service", // so this passes the test reliably. diff --git a/suture_test.go b/suture_test.go index 166236c..8c35470 100644 --- a/suture_test.go +++ b/suture_test.go @@ -525,7 +525,7 @@ func (s *FailableService) Serve() { everMultistarted = true panic("Multi-started the same service! " + s.name) } - s.existing += 1 + s.existing++ s.started <- true @@ -538,13 +538,13 @@ func (s *FailableService) Serve() { case Happy: // Do nothing on purpose. Life is good! case Fail: - s.existing -= 1 + s.existing-- if useStopChan { s.stop <- true } return case Panic: - s.existing -= 1 + s.existing-- panic("Panic!") case Hang: // or more specifically, "hang until I release you" @@ -553,7 +553,7 @@ func (s *FailableService) Serve() { useStopChan = true } case <-s.shutdown: - s.existing -= 1 + s.existing-- if useStopChan { s.stop <- true }