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
parent
4709a486db
commit
38d807bd23
|
@ -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 {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -127,5 +127,4 @@ func saveProgress(ctx context.Context, pr ProgressReader, t *trace) error {
|
|||
}
|
||||
t.items = append(t.items, *p)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue