From c4535c833dfdaef275d765968a2ed5513ef09097 Mon Sep 17 00:00:00 2001 From: Danny Yates Date: Wed, 8 Jan 2014 10:37:22 +0000 Subject: [PATCH] gofmt Docker-DCO-1.0-Signed-off-by: Danny Yates (github: codeaholics) --- server.go | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/server.go b/server.go index 7695b44a5c..32553105fd 100644 --- a/server.go +++ b/server.go @@ -1128,8 +1128,8 @@ func (srv *Server) ImagePull(localName string, tag string, out io.Writer, sf *ut // Retrieve the all the images to be uploaded in the correct order func (srv *Server) getImageList(localRepo map[string]string) ([]string, map[string][]string, error) { var ( - imageList []string - imagesSeen map[string]bool = make(map[string]bool) + imageList []string + imagesSeen map[string]bool = make(map[string]bool) tagsByImage map[string][]string = make(map[string][]string) ) @@ -1153,7 +1153,7 @@ func (srv *Server) getImageList(localRepo map[string]string) ([]string, map[stri } // reverse the image list for this tag (so the "most"-parent image is first) - for i, j := 0, len(imageListForThisTag) - 1; i < j; i, j = i + 1, j - 1 { + for i, j := 0, len(imageListForThisTag)-1; i < j; i, j = i+1, j-1 { imageListForThisTag[i], imageListForThisTag[j] = imageListForThisTag[j], imageListForThisTag[i] } @@ -1183,7 +1183,7 @@ func (srv *Server) pushRepository(r *registry.Registry, out io.Writer, localName for imgId, tags := range tagsByImage { for _, tag := range tags { imageIndex = append(imageIndex, ®istry.ImgData{ - ID: imgId, + ID: imgId, Tag: tag, }) } @@ -1643,24 +1643,24 @@ func (srv *Server) ImageDelete(name string, autoPrune bool) ([]APIRmi, error) { } } return srv.deleteImage(img, repository, tag) - } +} func (srv *Server) canDeleteImage(imgID string) error { - for _, container := range srv.runtime.List() { - parent, err := srv.runtime.repositories.LookupImage(container.Image) - if err != nil { + for _, container := range srv.runtime.List() { + parent, err := srv.runtime.repositories.LookupImage(container.Image) + if err != nil { return err - } + } - if err := parent.WalkHistory(func(p *Image) error { + if err := parent.WalkHistory(func(p *Image) error { if imgID == p.ID { return fmt.Errorf("Conflict, cannot delete %s because the container %s is using it", utils.TruncateID(imgID), utils.TruncateID(container.ID)) - } - return nil - }); err != nil { - return err } + return nil + }); err != nil { + return err } + } return nil } @@ -1676,7 +1676,7 @@ func (srv *Server) ImageGetCached(imgID string, config *Config) (*Image, error) imageMap := make(map[string][]string) for _, img := range images { imageMap[img.Parent] = append(imageMap[img.Parent], img.ID) - } + } sort.Strings(imageMap[imgID]) // Loop on the children of the given image and check the config for _, elem := range imageMap[imgID] {