refactor(sync): replace temporary variable pointer pattern with new() builtin
Simplify GetDeviceStatus return by using inline new() instead of assigning to a local variable and returning its address.
This commit is contained in:
@@ -226,8 +226,7 @@ func (d *OfflineDetector) GetDeviceStatus(ctx context.Context, deviceID pgtype.U
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
status := d.getDeviceStatus(device)
|
return new(d.getDeviceStatus(device)), nil
|
||||||
return &status, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *OfflineDetector) ListOfflineDevices(ctx context.Context) ([]DeviceOnlineStatus, error) {
|
func (d *OfflineDetector) ListOfflineDevices(ctx context.Context) ([]DeviceOnlineStatus, error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user