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()
|
||||
timeout = clicontext.GlobalDuration("timeout")
|
||||
namespace = clicontext.GlobalString("namespace")
|
||||
cancel = func() {}
|
||||
cancel gocontext.CancelFunc
|
||||
)
|
||||
|
||||
ctx = namespaces.WithNamespace(ctx, namespace)
|
||||
|
@ -69,7 +69,7 @@ func TestNewContainer(t *testing.T) {
|
||||
if container.ID() != 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)
|
||||
return
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ func (h Bar) Format(state fmt.State, r rune) {
|
||||
n += copy(p[n:], []byte(reset))
|
||||
|
||||
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)
|
||||
|
@ -217,6 +217,9 @@ func (c *Converter) fetchBlob(ctx context.Context, desc ocispec.Descriptor) erro
|
||||
defer r.Close()
|
||||
|
||||
gr, err := gzip.NewReader(r)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer gr.Close()
|
||||
|
||||
_, err = io.Copy(calc, gr)
|
||||
@ -237,6 +240,9 @@ func (c *Converter) fetchBlob(ctx context.Context, desc ocispec.Descriptor) erro
|
||||
|
||||
eg.Go(func() error {
|
||||
gr, err := gzip.NewReader(pr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer gr.Close()
|
||||
|
||||
_, err = io.Copy(calc, gr)
|
||||
|
@ -110,8 +110,7 @@ func TestOverlayOverlayMount(t *testing.T) {
|
||||
return
|
||||
}
|
||||
key := "/tmp/test"
|
||||
mounts, err := o.Prepare(ctx, key, "")
|
||||
if err != nil {
|
||||
if _, err = o.Prepare(ctx, key, ""); err != nil {
|
||||
t.Error(err)
|
||||
return
|
||||
}
|
||||
@ -119,6 +118,7 @@ func TestOverlayOverlayMount(t *testing.T) {
|
||||
t.Error(err)
|
||||
return
|
||||
}
|
||||
var mounts []mount.Mount
|
||||
if mounts, err = o.Prepare(ctx, "/tmp/layer2", "base"); err != nil {
|
||||
t.Error(err)
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user