From 38d807bd2381c7413e510687ba6c33f3e279d4d7 Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Tue, 13 Jun 2017 08:32:30 +0000 Subject: [PATCH] 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 --- cache/refs.go | 23 ++++++++++------------- util/progress/progress.go | 1 - util/progress/progress_test.go | 1 - 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/cache/refs.go b/cache/refs.go index f6217d8b..18410d96 100644 --- a/cache/refs.go +++ b/cache/refs.go @@ -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 { diff --git a/util/progress/progress.go b/util/progress/progress.go index dce19427..4a48479d 100644 --- a/util/progress/progress.go +++ b/util/progress/progress.go @@ -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) { diff --git a/util/progress/progress_test.go b/util/progress/progress_test.go index 7bddc98c..ab3ac5be 100644 --- a/util/progress/progress_test.go +++ b/util/progress/progress_test.go @@ -127,5 +127,4 @@ func saveProgress(ctx context.Context, pr ProgressReader, t *trace) error { } t.items = append(t.items, *p) } - return nil }