marshalers

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSON

func JSON(i interface{}) ([]byte, error)

JSON is a UTF-8 friendly marshaler. Go's json.Marshal is not UTF-8 friendly because it replaces the valid UTF-8 and JSON characters "&". "<", ">" with the "slash u" unicode escaped forms (e.g. \u0026). It preemptively escapes for HTML friendliness. Where text may include any of these characters, json.Marshal should not be used.

func YAML

func YAML(i interface{}) ([]byte, error)

YAML is a custom yaml marshaller that sets the encoder's indent to 4 spaces. Additionally, newlines are trimmed from the end of the bytes buffer.

Types

This section is empty.

Jump to

Keyboard shortcuts

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