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

jsonutil

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package jsonutil provides generic helpers for atomic JSON file I/O.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadJSON

func LoadJSON[T any](path string) (*T, error)

LoadJSON reads a JSON file at path and unmarshals it into *T.

func SaveJSON

func SaveJSON(dir, filename string, v any) (string, error)

SaveJSON writes v as pretty-printed JSON to dir/filename using an atomic write (temp file + rename). Parent directories are created as needed. Returns the full path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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