jsons

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: MIT Imports: 3 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

BMJ is a shortcut to BestEffortMinifyJSON

BMM is a shortcut to BestEffortMinifyMarshal

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

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

Functions

func BestEffortMinifyJSON added in v0.0.12

func BestEffortMinifyJSON(jsonStr string) string

BestEffortMinifyJSON reformats a json string to be minimal, ignoring any error.

func BestEffortMinifyMarshal added in v0.0.12

func BestEffortMinifyMarshal(v interface{}) string

BestEffortMinifyMarshal returns a mninified JSON encoding of v. Any error countered will cause "{}" be returned.

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