jsonopt

package
v0.2.15 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package jsonopt provides compact JSON encode/decode helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode[T any, P string | []byte](str P) T

Decode unmarshals JSON from str into T and ignores unmarshal errors.

func DecodeE

func DecodeE[T any, P string | []byte](str P) (T, error)

DecodeE unmarshals JSON from str into T.

func Encode

func Encode(obj any) string

Encode marshals obj into JSON and ignores marshal errors.

func EncodeE

func EncodeE(obj any) (string, error)

EncodeE marshals obj into a compact JSON string.

func EncodeFormat

func EncodeFormat(obj any) string

EncodeFormat marshals obj into indented JSON and ignores marshal errors.

func EncodeFormatE

func EncodeFormatE(obj any) (string, error)

EncodeFormatE marshals obj into an indented JSON string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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