edit

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MarkerBegin = "<!--envdoc:begin-->"
	MarkerEnd   = "<!--envdoc:end-->"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Editor

type Editor struct {
	// contains filtered or unexported fields
}

Editor handles in-place editing of files with marker-based content replacement

func NewEditor

func NewEditor(filePath string) *Editor

NewEditor creates a new Editor for the specified file path

func (*Editor) ReplaceSection

func (e *Editor) ReplaceSection(newContent []byte) error

ReplaceSection replaces the content between markers with newContent. If the file doesn't exist, it creates a new file with markers wrapping the content. If the file exists, it finds the markers and replaces only the content between them.

Jump to

Keyboard shortcuts

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