mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-25 22:39:38 +00:00
assign return value to a variable instead of using it directly
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user