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:
parent
902d660d2f
commit
07b6bc3fc7
1 changed files with 2 additions and 8 deletions
10
fs/store.go
10
fs/store.go
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue