bootloader,systemd: fix don't use Yoda conditions (ST1017)

Fix all the `don't use Yoda conditions (ST1017)` warnings found
by staticcheck.io.
This commit is contained in:
Michael Vogt
2022-08-19 10:05:23 +02:00
parent f83b1f1560
commit bae7d30786
2 changed files with 3 additions and 3 deletions

View File

@@ -559,7 +559,7 @@ func (matr bootimgMatrixGeneric) initializeBootPartitions(bootPartLabels []strin
// any kind).
func (matr bootimgMatrixGeneric) dropBootPartValue(bootPartValue string) error {
for x := range matr {
if "" != cToGoString(matr[x][MATRIX_ROW_PARTITION][:]) {
if cToGoString(matr[x][MATRIX_ROW_PARTITION][:]) != "" {
if bootPartValue == cToGoString(matr[x][MATRIX_ROW_VALUE][:]) {
// clear the string by setting the first element to 0 or NUL
matr[x][MATRIX_ROW_VALUE][0] = 0

View File

@@ -566,7 +566,7 @@ func (s *systemd) DaemonReexec() error {
}
func (s *systemd) EnableNoReload(serviceNames []string) error {
if 0 == len(serviceNames) {
if len(serviceNames) == 0 {
return nil
}
var args []string
@@ -593,7 +593,7 @@ func (s *systemd) Unmask(serviceName string) error {
}
func (s *systemd) DisableNoReload(serviceNames []string) error {
if 0 == len(serviceNames) {
if len(serviceNames) == 0 {
return nil
}
var args []string