The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/8059
This e-mail was sent by the LXC bot, direct replies will not reach the author unless they happen to be subscribed to this list. === Description (from pull-request) === Fixes ineffectual assignment warnings from https://goreportcard.com/report/github.com/lxc/lxd#ineffassign
From ef2dfa8748815befa7f6705798c23d7445cb4691 Mon Sep 17 00:00:00 2001 From: Thomas Parrott <thomas.parr...@canonical.com> Date: Tue, 20 Oct 2020 09:30:13 +0100 Subject: [PATCH 1/3] lxd/images: Fixes ineffectual assign warning Signed-off-by: Thomas Parrott <thomas.parr...@canonical.com> --- lxd/images.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lxd/images.go b/lxd/images.go index 39c7df8d75..d97e759408 100644 --- a/lxd/images.go +++ b/lxd/images.go @@ -241,7 +241,7 @@ func imgPostInstanceInfo(d *Daemon, r *http.Request, req api.ImagesPost, op *ope Tracker: &ioprogress.ProgressTracker{ Handler: func(value, speed int64) { percent := int64(0) - processed := int64(0) + var processed int64 if totalSize > 0 { percent = value From a4e89992943eb88dd8d1d1c010b332f626738170 Mon Sep 17 00:00:00 2001 From: Thomas Parrott <thomas.parr...@canonical.com> Date: Tue, 20 Oct 2020 09:31:05 +0100 Subject: [PATCH 2/3] lxd/resources/usb: Fixes ineffectual assign warning Signed-off-by: Thomas Parrott <thomas.parr...@canonical.com> --- lxd/resources/usb.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lxd/resources/usb.go b/lxd/resources/usb.go index 6479d252fc..fc88c459dc 100644 --- a/lxd/resources/usb.go +++ b/lxd/resources/usb.go @@ -186,7 +186,7 @@ func GetUSB() (*api.ResourcesUSB, error) { return nil, errors.Wrapf(err, "Failed to parse class ID %q", content) } - ok := false + var ok bool class, ok = usbid.Classes[usbid.ClassCode(iface.ClassID)] if ok { From 9aa5cfd3840415368d71064868391a570976c8fb Mon Sep 17 00:00:00 2001 From: Thomas Parrott <thomas.parr...@canonical.com> Date: Tue, 20 Oct 2020 09:32:13 +0100 Subject: [PATCH 3/3] lxd/storage/drivers/driver/lvm/volumes: Fixes ineffectual assign warning Signed-off-by: Thomas Parrott <thomas.parr...@canonical.com> --- lxd/storage/drivers/driver_lvm_volumes.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lxd/storage/drivers/driver_lvm_volumes.go b/lxd/storage/drivers/driver_lvm_volumes.go index fbe1ef16da..e761fa2582 100644 --- a/lxd/storage/drivers/driver_lvm_volumes.go +++ b/lxd/storage/drivers/driver_lvm_volumes.go @@ -433,12 +433,9 @@ func (d *lvm) GetVolumeDiskPath(vol Volume) (string, error) { // MountVolume mounts a volume. Returns true if this volume was our mount. func (d *lvm) MountVolume(vol Volume, op *operations.Operation) (bool, error) { - var err error - activated := false - // Activate LVM volume if needed. volDevPath := d.lvmDevPath(d.config["lvm.vg_name"], vol.volType, vol.contentType, vol.name) - activated, err = d.activateVolume(volDevPath) + activated, err := d.activateVolume(volDevPath) if err != nil { return false, err }
_______________________________________________ lxc-devel mailing list lxc-devel@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-devel