Unreachable code in semaphore.md
tommasodotNET opened this issue · comments
Tommaso Stocchi commented
In the semaphore pattern, the Release func has an unreachable return statement:
func (s *implementation) Release() error {
select {
case _ = <-s.sem:
return nil
case <-time.After(s.timeout):
return ErrIllegalRelease
}
return nil
}
The last return nil
will never be reached.