...

Package editor

import "github.com/google/go-containerregistry/internal/editor"
Overview
Index

Overview ▾

Package editor implements a simple interface for interactive file editing. It most likely does not work on windows.

func Edit

func Edit(input io.Reader, extension string) ([]byte, error)

Edit opens a temporary file in the default editor (per $EDITOR, falling back to "vi") with the contents of the given io.Reader and a filename ending in the given extension (to give a hint to the editor for syntax highlighting).

The contents of the edited file are returned, and the temporary file removed.