From 7f2aa5ef2daf8818628515d407b52dba6092ec42 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Mon, 20 Apr 2026 08:59:01 -0400 Subject: [PATCH] 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. --- cmd/server/tests/device_test.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cmd/server/tests/device_test.go b/cmd/server/tests/device_test.go index 5372314..d028251 100644 --- a/cmd/server/tests/device_test.go +++ b/cmd/server/tests/device_test.go @@ -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)