gear

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONParse

func JSONParse(str string) (map[string]interface{}, error)

JSONParse parses a JSON string into a map[string]interface{}.

It takes a JSON string as input and returns a map[string]interface{} and an error, if any. The map represents the parsed JSON object. If the JSON string cannot be parsed, the error is returned.

func JSONStringify

func JSONStringify(obj map[string]interface{}) string

JSONStringify converts a map[string]interface{} object into a JSON string.

It takes a map[string]interface{} object as input and returns a JSON string. If there is an error during the JSON marshaling process, an empty string is returned.

func PrettyString

func PrettyString(str string) (string, error)

PrettyString formats a JSON string into a more human-readable format.

It takes a JSON string as input and returns a formatted JSON string and an error, if any. The formatted JSON string is indented with two spaces.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL