1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

fs.store.Get(): use gorp.Get() instead of gorp.Select()

This commit is contained in:
Solomon Hykes 2013-02-15 21:48:04 -08:00
parent 902d660d2f
commit 07b6bc3fc7

View file

@ -83,14 +83,8 @@ func (store *Store) List(pth string) ([]*Image, error) {
}
func (store *Store) Get(id string) (*Image, error) {
images, err := store.orm.Select(Image{}, "select * from images where Id=?", id)
if err != nil {
return nil, err
}
if len(images) < 1 {
return nil, os.ErrNotExist
}
return images[0].(*Image), nil
img, err := store.orm.Get(Image{}, id)
return img.(*Image), err
}
func (store *Store) Create(layer Archive, parent *Image, pth, comment string) (*Image, error) {