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:
1 parent
2b139afce6
commit
416f10aa9d
1 file changed
+1
-2
@@ -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