jsons

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2020 License: MIT Imports: 3 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

BPJ is a shortcut (mostly used in tests) to BestEffortPrettyJSON.

BPM is a shortcut (mostly used in tests) to BestEffortPrettyMarshal.

Functions

func BestEffortPrettyJSON

func BestEffortPrettyJSON(jsonStr string) string

BestEffortPrettyJSON reformats a json string to be pretty, ignoring any error.

func BestEffortPrettyMarshal

func BestEffortPrettyMarshal(v interface{}) string

BestEffortPrettyMarshal does a best effort JSON marshaling of 'v' with human readable output. '{}' will be produced if there is any JSON marshal error. This function never fails.

func PrettyJSON

func PrettyJSON(jsonStr string) (string, error)

PrettyJSON reformats a json string to be pretty

func PrettyMarshal

func PrettyMarshal(v interface{}) (string, error)

PrettyMarshal does a JSON marshaling of 'v' with human readable output.

Types

This section is empty.

Jump to

Keyboard shortcuts

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