jsons

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2022 License: MIT Imports: 3 Imported by: 3 modules, 8 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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