mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-02 02:02:24 +00:00
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 <mark.d.ryan@intel.com>
This commit is contained in:
parent
f0172cd2a6
commit
cb2ce9339c
24
qemu/qemu.go
24
qemu/qemu.go
@ -842,11 +842,7 @@ type VFIODevice struct {
|
|||||||
|
|
||||||
// Valid returns true if the VFIODevice structure is valid and complete.
|
// Valid returns true if the VFIODevice structure is valid and complete.
|
||||||
func (vfioDev VFIODevice) Valid() bool {
|
func (vfioDev VFIODevice) Valid() bool {
|
||||||
if vfioDev.BDF == "" {
|
return vfioDev.BDF != ""
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// QemuParams returns the qemu parameters built out of this vfio device.
|
// 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.
|
// Valid returns true if the SCSIController structure is valid and complete.
|
||||||
func (scsiCon SCSIController) Valid() bool {
|
func (scsiCon SCSIController) Valid() bool {
|
||||||
if scsiCon.ID == "" {
|
return scsiCon.ID != ""
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// QemuParams returns the qemu parameters built out of this SCSIController device.
|
// 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.
|
// Valid returns true if the RngDevice structure is valid and complete.
|
||||||
func (v RngDevice) Valid() bool {
|
func (v RngDevice) Valid() bool {
|
||||||
if v.ID == "" {
|
return v.ID != ""
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// QemuParams returns the qemu parameters built out of the RngDevice.
|
// 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.
|
// Valid returns true if the balloonDevice structure is valid and complete.
|
||||||
func (b BalloonDevice) Valid() bool {
|
func (b BalloonDevice) Valid() bool {
|
||||||
if b.ID == "" {
|
return b.ID != ""
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// RTCBaseType is the qemu RTC base time type.
|
// RTCBaseType is the qemu RTC base time type.
|
||||||
|
Loading…
Reference in New Issue
Block a user