mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-18 10:46:35 +00:00
chore(deps): update dependency golangci/golangci-lint to v2.2.1 (#2110)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
@@ -113,7 +113,6 @@ func ApplicationInitialize() (*Application, error) {
|
||||
0,
|
||||
uintptr(unsafe.Pointer(application)),
|
||||
)
|
||||
|
||||
if !errors.Is(err, windows.NOERROR) {
|
||||
return nil, fmt.Errorf("syscall returned: %w", err)
|
||||
}
|
||||
|
||||
@@ -154,7 +154,6 @@ func (o *Operation) GetInstance() (*Instance, bool, error) {
|
||||
uintptr(unsafe.Pointer(&errorMessageUTF16)),
|
||||
uintptr(unsafe.Pointer(&errorDetails)),
|
||||
)
|
||||
|
||||
if !errors.Is(instanceResult, MI_RESULT_OK) {
|
||||
return nil, false, fmt.Errorf("instance result: %w (%s)", instanceResult, windows.UTF16PtrToString(errorMessageUTF16))
|
||||
}
|
||||
|
||||
@@ -109,13 +109,11 @@ func (s *Session) TestConnection() error {
|
||||
return result
|
||||
}
|
||||
|
||||
var err error
|
||||
|
||||
if _, _, err = operation.GetInstance(); err != nil {
|
||||
if _, _, err := operation.GetInstance(); err != nil {
|
||||
return fmt.Errorf("failed to get instance: %w", err)
|
||||
}
|
||||
|
||||
if err = operation.Close(); err != nil {
|
||||
if err := operation.Close(); err != nil {
|
||||
return fmt.Errorf("failed to close operation: %w", err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user