mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-10-19 11:09:03 +02:00
mi: correctness fixes for unmarshal, resource leak, and test robustness (#2501)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
049cab563b
commit
6cdc9db241
@@ -20,6 +20,7 @@ package mi
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"math"
|
||||
"unsafe"
|
||||
|
||||
"golang.org/x/sys/windows"
|
||||
@@ -91,9 +92,9 @@ func (e *Element) GetValue() (any, error) {
|
||||
case ValueTypeSINT64:
|
||||
return int64(e.value), nil
|
||||
case ValueTypeREAL32:
|
||||
return float32(e.value), nil
|
||||
return math.Float32frombits(uint32(e.value)), nil
|
||||
case ValueTypeREAL64:
|
||||
return float64(e.value), nil
|
||||
return math.Float64frombits(uint64(e.value)), nil
|
||||
case ValueTypeCHAR16:
|
||||
return uint16(e.value), nil
|
||||
case ValueTypeDATETIME:
|
||||
|
||||
Reference in New Issue
Block a user