Skip to content

Commit

Permalink
Added float64 support by @bilinenkisi (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
bilinenkisi authored Jan 28, 2024
1 parent 8468651 commit 6c94d73
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions wmi.go
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,18 @@ func (c *Client) loadEntity(dst interface{}, src *ole.IDispatch) (errFieldMismat
Reason: "not a Float32",
}
}
case float64:
switch f.Kind() {
case reflect.Float32, reflect.Float64:
f.SetFloat(val)
default:
return &ErrFieldMismatch{
StructType: of.Type(),
FieldName: n,
Reason: "not a Float64",
}
}

default:
if f.Kind() == reflect.Slice {
switch f.Type().Elem().Kind() {
Expand Down

0 comments on commit 6c94d73

Please sign in to comment.