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:
2026-04-20 08:58:36 -04:00
parent 2b139afce6
commit 416f10aa9d
+1 -2
View File
@@ -226,8 +226,7 @@ func (d *OfflineDetector) GetDeviceStatus(ctx context.Context, deviceID pgtype.U
return nil, err
}
status := d.getDeviceStatus(device)
return &status, nil
return new(d.getDeviceStatus(device)), nil
}
func (d *OfflineDetector) ListOfflineDevices(ctx context.Context) ([]DeviceOnlineStatus, error) {