Fix ineffassign warnings
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
parent
789330033a
commit
829845d268
@ -87,7 +87,7 @@ func appContext(clicontext *cli.Context) (gocontext.Context, gocontext.CancelFun
|
|||||||
ctx = gocontext.Background()
|
ctx = gocontext.Background()
|
||||||
timeout = clicontext.GlobalDuration("timeout")
|
timeout = clicontext.GlobalDuration("timeout")
|
||||||
namespace = clicontext.GlobalString("namespace")
|
namespace = clicontext.GlobalString("namespace")
|
||||||
cancel = func() {}
|
cancel gocontext.CancelFunc
|
||||||
)
|
)
|
||||||
|
|
||||||
ctx = namespaces.WithNamespace(ctx, namespace)
|
ctx = namespaces.WithNamespace(ctx, namespace)
|
||||||
|
@ -69,7 +69,7 @@ func TestNewContainer(t *testing.T) {
|
|||||||
if container.ID() != id {
|
if container.ID() != id {
|
||||||
t.Errorf("expected container id %q but received %q", id, container.ID())
|
t.Errorf("expected container id %q but received %q", id, container.ID())
|
||||||
}
|
}
|
||||||
if spec, err = container.Spec(); err != nil {
|
if _, err = container.Spec(); err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ func (h Bar) Format(state fmt.State, r rune) {
|
|||||||
n += copy(p[n:], []byte(reset))
|
n += copy(p[n:], []byte(reset))
|
||||||
|
|
||||||
if negative > 0 {
|
if negative > 0 {
|
||||||
n += copy(p[n:len(p)-1], bytes.Repeat([]byte("-"), negative))
|
copy(p[n:len(p)-1], bytes.Repeat([]byte("-"), negative))
|
||||||
}
|
}
|
||||||
|
|
||||||
state.Write(p)
|
state.Write(p)
|
||||||
|
@ -217,6 +217,9 @@ func (c *Converter) fetchBlob(ctx context.Context, desc ocispec.Descriptor) erro
|
|||||||
defer r.Close()
|
defer r.Close()
|
||||||
|
|
||||||
gr, err := gzip.NewReader(r)
|
gr, err := gzip.NewReader(r)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
defer gr.Close()
|
defer gr.Close()
|
||||||
|
|
||||||
_, err = io.Copy(calc, gr)
|
_, err = io.Copy(calc, gr)
|
||||||
@ -237,6 +240,9 @@ func (c *Converter) fetchBlob(ctx context.Context, desc ocispec.Descriptor) erro
|
|||||||
|
|
||||||
eg.Go(func() error {
|
eg.Go(func() error {
|
||||||
gr, err := gzip.NewReader(pr)
|
gr, err := gzip.NewReader(pr)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
defer gr.Close()
|
defer gr.Close()
|
||||||
|
|
||||||
_, err = io.Copy(calc, gr)
|
_, err = io.Copy(calc, gr)
|
||||||
|
@ -110,8 +110,7 @@ func TestOverlayOverlayMount(t *testing.T) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
key := "/tmp/test"
|
key := "/tmp/test"
|
||||||
mounts, err := o.Prepare(ctx, key, "")
|
if _, err = o.Prepare(ctx, key, ""); err != nil {
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -119,6 +118,7 @@ func TestOverlayOverlayMount(t *testing.T) {
|
|||||||
t.Error(err)
|
t.Error(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
var mounts []mount.Mount
|
||||||
if mounts, err = o.Prepare(ctx, "/tmp/layer2", "base"); err != nil {
|
if mounts, err = o.Prepare(ctx, "/tmp/layer2", "base"); err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user