Not only is this a more common idiom, it'll make finding bugs easier, and it'll make porting to Go 1.1 easier. Go 1.1 will not require the final return or panic because it has a notion of terminating statements.
@@ -626,7 +626,7 @@ func (container *Container) WaitTimeout(timeout time.Duration) error {
case <-done:
return nil
}
- return nil
+ panic("unreachable")
func (container *Container) EnsureMounted() error {
@@ -184,7 +184,7 @@ func (alloc *PortAllocator) Release(port int) error {
default:
return errors.New("Too many ports have been released")
func newPortAllocator(start, end int) (*PortAllocator, error) {
@@ -202,7 +202,7 @@ func (r *bufReader) Read(p []byte) (n int, err error) {
r.wait.Wait()
- return
func (r *bufReader) Close() error {