package edit
import "cmd/internal/edit"
Package edit implements buffered position-based editing of byte slices.
Index ¶
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
A Buffer is a queue of edits to apply to a given byte slice.
func NewBuffer ¶
NewBuffer returns a new buffer to accumulate changes to an initial data slice. The returned buffer maintains a reference to the data, so the caller must ensure the data is not modified until after the Buffer is done being used.
func (*Buffer) Bytes ¶
Bytes returns a new byte slice containing the original data with the queued edits applied.
func (*Buffer) Delete ¶
func (*Buffer) Insert ¶
func (*Buffer) Replace ¶
func (*Buffer) String ¶
String returns a string containing the original data with the queued edits applied.
Source Files ¶
- Version
- v1.24.0 (latest)
- Published
- Feb 10, 2025
- Platform
- linux/amd64
- Imports
- 2 packages
- Last checked
- 6 minutes ago –
Tools for package owners.