From 416f10aa9d3723601318451c85b7bb2e0ac497c2 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Mon, 20 Apr 2026 08:58:36 -0400 Subject: [PATCH] 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. --- internal/sync/offline.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/sync/offline.go b/internal/sync/offline.go index 5f6ccaa..167ecff 100644 --- a/internal/sync/offline.go +++ b/internal/sync/offline.go @@ -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) {