Help us shape the future of Go! Take the 2026 Go Developer Survey

jsonutil

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeepCopy

func DeepCopy(src, dest interface{}) error

DeepCopy performs a deep copy of a JSON-compatible Go value.

func Marshal

func Marshal(v interface{}) ([]byte, error)

Marshal marshals a Go value to a JSON byte slice.

func MarshalIndent

func MarshalIndent(v interface{}, prefix, indent string) ([]byte, error)

MarshalIndent marshals a Go value to a pretty-printed JSON byte slice.

func Merge

func Merge(dst, src interface{}) error

Merge merges two JSON-compatible Go values. The values must be maps or structs.

func PrettyPrint

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

PrettyPrint prints a pretty-printed JSON string of a Go value.

func Query

func Query(data []byte, query string) (interface{}, error)

Query allows querying JSON data using a simple dot notation.

func Unmarshal

func Unmarshal(data []byte, v interface{}) error

Unmarshal unmarshals a JSON byte slice to a Go value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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