func nicUnitRange(l object.VirtualDeviceList) (int, error) {
	// No NICs means no range
	if len(l) < 1 {
		return 0, nil
	}

	high := int32(networkInterfacePciDeviceOffset)

	for _, v := range l {
		d := v.GetVirtualDevice()
		if d.UnitNumber == nil {
			return 0, fmt.Errorf("device at key %d has no unit number", d.Key)
		}
		if *d.UnitNumber > high {
			high = *d.UnitNumber
		}
	}
	return int(high - networkInterfacePciDeviceOffset + 1), nil
}
func nicUnitRange(l object.VirtualDeviceList) (int, error) {
	
	if len(l) < 1 {
		return 0, nil
	}

	high := int32(networkInterfacePciDeviceOffset)

	for _, v := range l {
		d := v.GetVirtualDevice()
		if d.UnitNumber == nil {
			return 0, fmt.Errorf("device at key %d has no unit number", d.Key)
		}
		if *d.UnitNumber > high {
			high = *d.UnitNumber
		}
	}
	return int(high - networkInterfacePciDeviceOffset + 1), nil
}
func nicUnitRange ( l object . VirtualDeviceList ) ( int , error ) { // No NICs means no range if len ( l ) < 1 { return 0 , nil } high := int32 ( networkInterfacePciDeviceOffset ) for _ , v := range l { d := v . GetVirtualDevice ( ) if d . UnitNumber == nil { return 0 , fmt . Errorf ( " " , d . Key ) } if * d . UnitNumber > high { high = * d . UnitNumber } } return int ( high - networkInterfacePciDeviceOffset + 1 ) , nil }
// nicUnitRange calculates a range of units given a certain VirtualDeviceList,
// which should be network interfaces.  It's used in network interface refresh
// logic to determine how many subresources may end up in state.
nicUnitRange calculates a range of units given a certain VirtualDeviceList which should be network interfaces . It s used in network interface refresh logic to determine how many subresources may end up in state .