assign return value to a variable instead of using it directly

This commit is contained in:
Shingo Omura
2025-07-22 10:05:43 +09:00
parent 7f27c88d0f
commit f3d4b216f3

View File

@@ -51,10 +51,12 @@ func GetPCIeRootAttributeByPCIBusID(pciBusID string) (DeviceAttribute, error) {
pciRootPart := strings.Split(strings.TrimPrefix(sysDevicesPath, sysfs.devices("")+"/"), "/")[0]
return DeviceAttribute{
attr := DeviceAttribute{
Name: StandardDeviceAttributePCIeRoot,
Value: resourceapi.DeviceAttribute{StringValue: &pciRootPart},
}, nil
}
return attr, nil
}
// resolveSysDevicesPath resolves the /sys/devices path from the PCI Bus ID