json

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalid = errors.New("invalid json")

Functions

This section is empty.

Types

type Bytes

type Bytes []byte

func FromMap

func FromMap(m map[string]any) Bytes

FromMap returns a JSON Bytes with sorted keys from the map.

If the map is invalid, it returns a JSON Bytes with the error.

func (Bytes) Bytes

func (b Bytes) Bytes() []byte

Bytes returns JSON underlying byte slice value.

If the underlying JSON value is invalid, it returns a JSON byte slice with the error.

func (Bytes) String

func (b Bytes) String() string

String returns JSON underlying string value.

If the underlying JSON value is invalid, it returns a JSON string with the error.

Jump to

Keyboard shortcuts

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