Simplify boolean conditionals

This commit is contained in:
Peter Rifel 2025-08-22 20:17:36 -05:00
parent 701f01a26b
commit ec67c4acdc
No known key found for this signature in database
3 changed files with 6 additions and 6 deletions

View File

@ -107,7 +107,7 @@ func (f *FakeDomainAPI) UpdateDNSZoneRecords(req *domain.UpdateDNSZoneRecordsReq
break
}
}
if found == false {
if !found {
return nil, fmt.Errorf("could not find record %s to delete", *change.Delete.ID)
}

View File

@ -265,7 +265,7 @@ func (b *KopsModelContext) CloudTags(name string, shared bool) map[string]string
}
case kops.CloudProviderScaleway:
for k, v := range b.Cluster.Spec.CloudLabels {
if k == scaleway.TagClusterName && shared == true {
if k == scaleway.TagClusterName && shared {
klog.V(4).Infof("Skipping %q tag for shared resource", scaleway.TagClusterName)
continue
}

View File

@ -92,7 +92,7 @@ func (s *Instance) Find(c *fi.CloudupContext) (*Instance, error) {
alreadyTagged = true
}
}
if alreadyTagged == true {
if alreadyTagged {
continue
}
@ -107,7 +107,7 @@ func (s *Instance) Find(c *fi.CloudupContext) (*Instance, error) {
if err != nil {
return nil, fmt.Errorf("checking image differences in server %s (%s): %w", server.Name, server.ID, err)
}
if diff == true {
if diff {
needsUpdate = append(needsUpdate, server.ID)
continue
}
@ -117,7 +117,7 @@ func (s *Instance) Find(c *fi.CloudupContext) (*Instance, error) {
if err != nil {
return nil, fmt.Errorf("checking user-data differences in server %s (%s): %w", server.Name, server.ID, err)
}
if diff == true {
if diff {
needsUpdate = append(needsUpdate, server.ID)
}
}
@ -457,7 +457,7 @@ func findFirstFreeIndex(existing []*instance.Server) int {
break
}
}
if found == false {
if !found {
return index
}
}