Merge remote-tracking branch 'dominikh/minor-code-touchups'

This commit is contained in:
Solomon Hykes 2013-04-04 16:20:37 -07:00
commit 586a79cca0
5 changed files with 10 additions and 12 deletions

View file

@ -99,7 +99,7 @@ func (srv *Server) CmdLogin(stdin io.ReadCloser, stdout io.Writer, args ...strin
}
if err != nil {
if err != io.EOF {
fmt.Fprint(stdout, "Read error: %v\n", err)
fmt.Fprintf(stdout, "Read error: %v\n", err)
}
break
}
@ -512,10 +512,9 @@ func (srv *Server) CmdPush(stdin io.ReadCloser, stdout io.Writer, args ...string
return err
}
return nil
} else {
return err
}
return nil
return err
}
err = srv.runtime.graph.PushImage(stdout, img, srv.runtime.authConfig)
if err != nil {

View file

@ -652,7 +652,7 @@ func (container *Container) WaitTimeout(timeout time.Duration) error {
case <-done:
return nil
}
return nil
panic("unreachable")
}
func (container *Container) EnsureMounted() error {

View file

@ -187,7 +187,7 @@ func (alloc *PortAllocator) Release(port int) error {
default:
return errors.New("Too many ports have been released")
}
return nil
panic("unreachable")
}
func newPortAllocator(start, end int) (*PortAllocator, error) {

View file

@ -22,10 +22,10 @@ func nuke(runtime *Runtime) error {
var wg sync.WaitGroup
for _, container := range runtime.List() {
wg.Add(1)
go func() {
container.Kill()
wg.Add(-1)
}()
go func(c *Container) {
c.Kill()
wg.Done()
}(container)
}
wg.Wait()
return os.RemoveAll(runtime.root)
@ -91,7 +91,6 @@ func newTestRuntime() (*Runtime, error) {
return nil, err
}
if err := CopyDirectory(unitTestStoreBase, root); err != nil {
panic(err)
return nil, err
}

View file

@ -202,7 +202,7 @@ func (r *bufReader) Read(p []byte) (n int, err error) {
}
r.wait.Wait()
}
return
panic("unreachable")
}
func (r *bufReader) Close() error {