jsonutil

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package jsonutil wraps goccy/go-json as a drop-in for encoding/json.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(v any) ([]byte, error)

Marshal encodes v to JSON.

func MarshalIndent

func MarshalIndent(v any, prefix, indent string) ([]byte, error)

MarshalIndent encodes v to indented JSON.

func Unmarshal

func Unmarshal(b []byte, v any) error

Unmarshal decodes JSON data into v.

Types

type Encoder

type Encoder interface{ Encode(v any) error }

Encoder is satisfied by both goccy and encoding/json encoders.

func NewEncoder

func NewEncoder(w io.Writer) Encoder

NewEncoder returns a streaming JSON encoder writing to w.

Jump to

Keyboard shortcuts

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