Documentation ¶
Overview ¶
Package jsonz provides various utilities for working with JSON.
Index ¶
- func MustMarshal(v any) []byte
- func MustMarshalPretty(v any) []byte
- func MustMarshalPrettyString(v any) string
- func MustMarshalString(v any) string
- func MustUnmarshal[T any](data []byte) T
- func MustUnmarshalString[T any](data string) T
- func Unmarshal[T any](data []byte) (T, error)
- func UnmarshalString[T any](data string) (T, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustMarshal ¶
MustMarshal is like json.Marshal but panics on error.
func MustMarshalPretty ¶
MustMarshalPretty is like json.MarshalIndent with prefix = "" and indent = " " but panics on error.
func MustMarshalPrettyString ¶
MustMarshalPrettyString is like [MustMarshalIndent] but returns a string.
func MustMarshalString ¶
MustMarshalString is like MustMarshal but returns a string.
func MustUnmarshal ¶
MustUnmarshal is like Unmarshal but panics on error.
func MustUnmarshalString ¶
MustUnmarshalString is like UnmarshalString but panics on error.
func Unmarshal ¶
Unmarshal is like json.Unmarshal but instantiates the target using a generic type.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.