diff options
Diffstat (limited to 'cloudflare/json.go')
| -rw-r--r-- | cloudflare/json.go | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/cloudflare/json.go b/cloudflare/json.go deleted file mode 100644 index b7c71a8..0000000 --- a/cloudflare/json.go +++ /dev/null @@ -1,25 +0,0 @@ -// This is a simple example -package cloudflare - -import ( - "encoding/json" -) - -// formatJSON takes an unformatted JSON string and returns a formatted version. -func FormatJSON(unformattedJSON string) (string, error) { - var jsonData interface{} - - // Decode the JSON string into an interface - err := json.Unmarshal([]byte(unformattedJSON), &jsonData) - if err != nil { - return "", err - } - - // Re-encode the JSON with indentation for formatting - formattedJSON, err := json.MarshalIndent(jsonData, "", " ") - if err != nil { - return "", err - } - - return string(formattedJSON), nil -} |
