editor

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package editor opens an external editor on a temp file and returns the edited bytes. It deliberately keeps no state — callers serialize what they want, hand a hint at the file extension, and parse what comes back.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnchanged = errors.New("editor: file unchanged")

ErrUnchanged is returned when the user saved without modifying the file.

Functions

func Edit

func Edit(basename, ext string, initial []byte) ([]byte, error)

Edit launches an editor on a temp file pre-filled with `initial`. The temp file is named `<basename>.<ext>` so editors pick the right syntax. Returns the edited bytes or ErrUnchanged.

Types

This section is empty.

Jump to

Keyboard shortcuts

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