From cb2ce9339c38b3d145660475b859406fb0148a01 Mon Sep 17 00:00:00 2001 From: Mark Ryan Date: Mon, 28 Jan 2019 16:17:24 +0100 Subject: [PATCH] Fix staticcheck S1008 static check was complaining about code that looked like if x == "" { return false } return true when what it wants to see is return x != "". This commit fixes the issue. Signed-off-by: Mark Ryan --- qemu/qemu.go | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/qemu/qemu.go b/qemu/qemu.go index 47fc3fadf2..9703018d57 100644 --- a/qemu/qemu.go +++ b/qemu/qemu.go @@ -842,11 +842,7 @@ type VFIODevice struct { // Valid returns true if the VFIODevice structure is valid and complete. func (vfioDev VFIODevice) Valid() bool { - if vfioDev.BDF == "" { - return false - } - - return true + return vfioDev.BDF != "" } // QemuParams returns the qemu parameters built out of this vfio device. @@ -889,11 +885,7 @@ type SCSIController struct { // Valid returns true if the SCSIController structure is valid and complete. func (scsiCon SCSIController) Valid() bool { - if scsiCon.ID == "" { - return false - } - - return true + return scsiCon.ID != "" } // QemuParams returns the qemu parameters built out of this SCSIController device. @@ -1094,11 +1086,7 @@ type RngDevice struct { // Valid returns true if the RngDevice structure is valid and complete. func (v RngDevice) Valid() bool { - if v.ID == "" { - return false - } - - return true + return v.ID != "" } // QemuParams returns the qemu parameters built out of the RngDevice. @@ -1184,11 +1172,7 @@ func (b BalloonDevice) QemuParams(_ *Config) []string { // Valid returns true if the balloonDevice structure is valid and complete. func (b BalloonDevice) Valid() bool { - if b.ID == "" { - return false - } - - return true + return b.ID != "" } // RTCBaseType is the qemu RTC base time type.