From ff141a469d83d99ac3e09bbb329df2eec3b955fd Mon Sep 17 00:00:00 2001 From: Mario Valderrama <15158349+avorima@users.noreply.github.com> Date: Thu, 23 Feb 2023 12:07:27 +0100 Subject: [PATCH] Indent JSON files (#99) --- grafana/dashboard.go | 2 +- grafana/datasource.go | 2 +- grafana/folder.go | 2 +- grafana/notification.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/grafana/dashboard.go b/grafana/dashboard.go index d3b4f58..e1b5d38 100644 --- a/grafana/dashboard.go +++ b/grafana/dashboard.go @@ -46,7 +46,7 @@ func PullDashboard(grafanaURL string, apiKey string, directory string, tag strin continue } rawBoard.ID = 0 - b, err := json.Marshal(rawBoard) + b, err := json.MarshalIndent(rawBoard, "", " ") if err != nil { return err } diff --git a/grafana/datasource.go b/grafana/datasource.go index 8dfd42d..656f2a2 100644 --- a/grafana/datasource.go +++ b/grafana/datasource.go @@ -28,7 +28,7 @@ func PullDatasources(grafanaURL string, apiKey string, directory string) error { } for _, datasource := range datasources { - b, err := json.Marshal(datasource) + b, err := json.MarshalIndent(datasource, "", " ") if err != nil { return err } diff --git a/grafana/folder.go b/grafana/folder.go index 6a3c8cb..124c123 100644 --- a/grafana/folder.go +++ b/grafana/folder.go @@ -29,7 +29,7 @@ func PullFolders(grafanaURL string, apiKey string, directory string) error { } for _, folder := range folders { - b, err := json.Marshal(folder) + b, err := json.MarshalIndent(folder, "", " ") if err != nil { return err } diff --git a/grafana/notification.go b/grafana/notification.go index 4b52969..e9d9823 100644 --- a/grafana/notification.go +++ b/grafana/notification.go @@ -28,7 +28,7 @@ func PullNotifications(grafanaURL string, apiKey string, directory string) error } for _, notification := range notifications { - b, err := json.Marshal(notification) + b, err := json.MarshalIndent(notification, "", " ") if err != nil { return err }