From 6730dc927cf2306283a626633b763732ada1ccb8 Mon Sep 17 00:00:00 2001 From: Christoph Hartmann Date: Sun, 17 Sep 2023 22:39:58 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20use=20proper=20dict=20datatypes?= =?UTF-8?q?=20for=20macos.userPreferences=20(#1759)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- providers/os/resources/macos.go | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/providers/os/resources/macos.go b/providers/os/resources/macos.go index 59613ecf50..1e0924dbb9 100644 --- a/providers/os/resources/macos.go +++ b/providers/os/resources/macos.go @@ -19,17 +19,12 @@ import ( func (m *mqlMacos) userPreferences() (map[string]interface{}, error) { conn := m.MqlRuntime.Connection.(shared.Connection) - - res := map[string]interface{}{} preferences, err := macos.NewPreferences(conn).UserPreferences() if err != nil { return nil, err } - for k := range preferences { - res[k] = preferences[k] - } - return res, nil + return convert.JsonToDict(preferences) } func (m *mqlMacos) userHostPreferences() (map[string]interface{}, error) { @@ -40,11 +35,7 @@ func (m *mqlMacos) userHostPreferences() (map[string]interface{}, error) { return nil, err } - res := map[string]interface{}{} - for k := range preferences { - res[k] = preferences[k] - } - return res, nil + return convert.JsonToDict(preferences) } func (m *mqlMacos) globalAccountPolicies() (map[string]interface{}, error) {