Skip to content

Commit bc01643

Browse files
fix(fleetcontrol): use type conversion instead of struct literal for tag conversion
Changed from struct literal to direct type conversion when converting EntityManagementTag to FleetControlTag, as both types have identical structure. This resolves gosimple linter warning S1016. - Before: fleetcontrol.FleetControlTag{Key: tag.Key, Values: tag.Values} - After: fleetcontrol.FleetControlTag(tag)
1 parent 0d463f9 commit bc01643

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

internal/fleetcontrol/helpers.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -585,10 +585,7 @@ func FilterFleetEntityFromEntityManagement(entity fleetcontrol.EntityManagementF
585585
if showTags && len(entity.Tags) > 0 {
586586
tags := make([]fleetcontrol.FleetControlTag, len(entity.Tags))
587587
for i, tag := range entity.Tags {
588-
tags[i] = fleetcontrol.FleetControlTag{
589-
Key: tag.Key,
590-
Values: tag.Values,
591-
}
588+
tags[i] = fleetcontrol.FleetControlTag(tag)
592589
}
593590
output.Tags = tags
594591
}

0 commit comments

Comments
 (0)