fix go vet failures

cache/refs.go:110::error: unreachable code (vet)
util/progress/progress.go:119::error: unreachable code (vet)
util/progress/progress_test.go:130::error: unreachable code (vet)

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
docker-18.09
Akihiro Suda 2017-06-13 08:32:30 +00:00
parent 4709a486db
commit 38d807bd23
3 changed files with 10 additions and 15 deletions

23
cache/refs.go vendored
View File

@ -94,20 +94,17 @@ func (cr *cacheRecord) Mount() ([]mount.Mount, error) {
return nil, errors.Wrapf(err, "failed to mount %s", cr.id)
}
return m, nil
} else {
if cr.viewMount == nil { // TODO: handle this better
cr.view = generateID()
m, err := cr.cm.Snapshotter.View(context.TODO(), cr.view, cr.id)
if err != nil {
cr.view = ""
return nil, errors.Wrapf(err, "failed to mount %s", cr.id)
}
cr.viewMount = m
}
return cr.viewMount, nil
}
return nil, errors.New("snapshot mount not implemented")
if cr.viewMount == nil { // TODO: handle this better
cr.view = generateID()
m, err := cr.cm.Snapshotter.View(context.TODO(), cr.view, cr.id)
if err != nil {
cr.view = ""
return nil, errors.Wrapf(err, "failed to mount %s", cr.id)
}
cr.viewMount = m
}
return cr.viewMount, nil
}
func (cr *cacheRecord) ID() string {

View File

@ -116,7 +116,6 @@ func (pr *progressReader) Read(ctx context.Context) (*Progress, error) {
pr.cond.Wait()
}
}
return nil, errors.Errorf("Read not implemented")
}
func (pr *progressReader) append(pw *progressWriter) {

View File

@ -127,5 +127,4 @@ func saveProgress(ctx context.Context, pr ProgressReader, t *trace) error {
}
t.items = append(t.items, *p)
}
return nil
}