From 0e0689da236439a6c738f3429034ffe2bb2b35ce Mon Sep 17 00:00:00 2001 From: bitxeno <137328844+bitxeno@users.noreply.github.com> Date: Wed, 18 Sep 2024 16:16:53 +0800 Subject: [PATCH] ci: fix linter error --- internal/manager/device_manager.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/manager/device_manager.go b/internal/manager/device_manager.go index 9eb6f0d..f3c9575 100644 --- a/internal/manager/device_manager.go +++ b/internal/manager/device_manager.go @@ -55,7 +55,8 @@ func (dm *DeviceManager) GetDeviceByUDID(udid string) (*model.Device, bool) { func (dm *DeviceManager) AppendProductInfo(dev *model.Device) { timeout := 10 * time.Second - ctx, _ := context.WithTimeout(context.Background(), timeout) + ctx, cancel := context.WithTimeout(context.Background(), timeout) + defer cancel() cmd := exec.CommandContext(ctx, "ideviceinfo", "-u", dev.UDID, "-n") cmd.Dir = app.Config.Server.DataDir output, err := cmd.CombinedOutput()