diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..75766f6 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module wmi + +go 1.13 diff --git a/wmi.go b/wmi.go index 652ec74..b4bb4f0 100644 --- a/wmi.go +++ b/wmi.go @@ -344,6 +344,9 @@ func (c *Client) loadEntity(dst interface{}, src *ole.IDispatch) (errFieldMismat f = f.Elem() } n := v.Type().Field(i).Name + if n[0] < 'A' || n[0] > 'Z' { + continue + } if !f.CanSet() { return &ErrFieldMismatch{ StructType: of.Type(), @@ -577,7 +580,7 @@ func CreateQuery(src interface{}, where string, class ...string) string { } b.WriteString(strings.Join(fields, ", ")) b.WriteString(" FROM ") - if len(class) > 0{ + if len(class) > 0 { b.WriteString(class[0]) } else { b.WriteString(t.Name())