From 9293c05a665410a5e16d68ad7113699f043ab562 Mon Sep 17 00:00:00 2001 From: "lilong.129" Date: Sat, 23 Nov 2024 15:13:56 +0800 Subject: [PATCH] fix: lint warning --- hrp/internal/version/VERSION | 2 +- hrp/pkg/uixt/android_adb_driver.go | 3 ++- hrp/pkg/uixt/harmony_hdc_driver.go | 3 ++- hrp/pkg/uixt/interface.go | 2 +- hrp/pkg/uixt/ios_device.go | 3 +++ hrp/pkg/uixt/ios_driver.go | 3 ++- hrp/pkg/uixt/ios_stub_driver.go | 4 ++-- 7 files changed, 13 insertions(+), 7 deletions(-) diff --git a/hrp/internal/version/VERSION b/hrp/internal/version/VERSION index bc7f3998..6ecbcf35 100644 --- a/hrp/internal/version/VERSION +++ b/hrp/internal/version/VERSION @@ -1 +1 @@ -v5.0.0+2411231506 +v5.0.0+2411231513 diff --git a/hrp/pkg/uixt/android_adb_driver.go b/hrp/pkg/uixt/android_adb_driver.go index 08a72248..ec8e42c2 100644 --- a/hrp/pkg/uixt/android_adb_driver.go +++ b/hrp/pkg/uixt/android_adb_driver.go @@ -1047,5 +1047,6 @@ func (ad *adbDriver) RecordScreen(folderPath string, duration time.Duration) (vi return filepath.Abs(fileName) } -func (ad *adbDriver) TearDown() { +func (ad *adbDriver) TearDown() error { + return nil } diff --git a/hrp/pkg/uixt/harmony_hdc_driver.go b/hrp/pkg/uixt/harmony_hdc_driver.go index c5144b67..e6251408 100644 --- a/hrp/pkg/uixt/harmony_hdc_driver.go +++ b/hrp/pkg/uixt/harmony_hdc_driver.go @@ -338,5 +338,6 @@ func (hd *hdcDriver) RecordScreen(folderPath string, duration time.Duration) (vi return "", nil } -func (hd *hdcDriver) TearDown() { +func (hd *hdcDriver) TearDown() error { + return nil } diff --git a/hrp/pkg/uixt/interface.go b/hrp/pkg/uixt/interface.go index 8a58564a..03083cb1 100644 --- a/hrp/pkg/uixt/interface.go +++ b/hrp/pkg/uixt/interface.go @@ -654,5 +654,5 @@ type IWebDriver interface { GetDriverResults() []*DriverResult RecordScreen(folderPath string, duration time.Duration) (videoPath string, err error) - TearDown() + TearDown() error } diff --git a/hrp/pkg/uixt/ios_device.go b/hrp/pkg/uixt/ios_device.go index 036cb8a9..b621b97c 100644 --- a/hrp/pkg/uixt/ios_device.go +++ b/hrp/pkg/uixt/ios_device.go @@ -356,6 +356,9 @@ func (dev *IOSDevice) Init() error { dev.d.UserspaceTUNPort = info.UserspaceTUNPort dev.d.UserspaceTUN = info.UserspaceTUN rsdService, err := ios.NewWithAddrPortDevice(info.Address, info.RsdPort, dev.d) + if err != nil { + return err + } defer rsdService.Close() rsdProvider, err := rsdService.Handshake() if err != nil { diff --git a/hrp/pkg/uixt/ios_driver.go b/hrp/pkg/uixt/ios_driver.go index 9bc236ed..45841a25 100644 --- a/hrp/pkg/uixt/ios_driver.go +++ b/hrp/pkg/uixt/ios_driver.go @@ -997,9 +997,10 @@ func (wd *wdaDriver) GetDriverResults() []*DriverResult { return wd.Driver.driverResults } -func (wd *wdaDriver) TearDown() { +func (wd *wdaDriver) TearDown() error { wd.mjpegClient.CloseIdleConnections() wd.client.CloseIdleConnections() + return nil } type rawResponse []byte diff --git a/hrp/pkg/uixt/ios_stub_driver.go b/hrp/pkg/uixt/ios_stub_driver.go index 8713b9fc..11d8a277 100644 --- a/hrp/pkg/uixt/ios_stub_driver.go +++ b/hrp/pkg/uixt/ios_stub_driver.go @@ -537,9 +537,9 @@ func (s *stubIOSDriver) LogoutNoneUI(packageName string) error { return nil } -func (s *stubIOSDriver) TearDown() { +func (s *stubIOSDriver) TearDown() error { s.Driver.client.CloseIdleConnections() - return + return nil } func (s *stubIOSDriver) getLoginAppInfo(packageName string) (info AppLoginInfo, err error) {