refactor(tests): replace temporary variable pointer pattern with new() builtin

Simplify device update test by using new(false) and new(int32(10)) instead
of declaring named sync variables and taking their addresses.
This commit is contained in:
john-okeefe committed 2026-04-20 08:59:01 -04:00
1 parent 416f10aa9d
commit 7f2aa5ef2d
1 file changed
+2 -4
+2 -4
View File
@@ -147,12 +147,10 @@ func TestUpdateDevice(t *testing.T) {
device := setup.CreateDevice(t, "Test Device", "koreader", "test-device-123")
// Update device
syncEnabled := false
syncFreq := int32(10)
updateRequest := handlers.DeviceUpdateRequest{
DeviceName: "Updated Device Name",
SyncEnabled: &syncEnabled,
SyncFrequencyMinutes: &syncFreq,
SyncEnabled: new(false),
SyncFrequencyMinutes: new(int32(10)),
}
updateBody, _ := json.Marshal(updateRequest)