fileutil

package
v0.32.2 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package fileutil provides small shared helpers for reading JSON files and writing config files with backup-on-overwrite semantics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BackupDir

func BackupDir() string

BackupDir returns the shared backup root used before overwriting files.

func ReadJSON

func ReadJSON(path string) (map[string]any, error)

ReadJSON reads a JSON object file into a generic map.

func WriteWithBackup

func WriteWithBackup(path string, data []byte, integration ...string) error

WriteWithBackup writes data to path via temp file + rename, backing up any existing file first. Callers may optionally pass one integration name to store backups under BackupDir()/.../<integration>/.

Types

This section is empty.

Jump to

Keyboard shortcuts

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