go/src/cmd/internal/edit/edit.go

type Buffer

type edit

type edits

func (x edits) Len() int      {}

func (x edits) Swap(i, j int) {}

func (x edits) Less(i, j int) bool {}

// 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 NewBuffer(data []byte) *Buffer {}

func (b *Buffer) Insert(pos int, new string) {}

func (b *Buffer) Delete(start, end int) {}

func (b *Buffer) Replace(start, end int, new string) {}

// Bytes returns a new byte slice containing the original data
// with the queued edits applied.
func (b *Buffer) Bytes() []byte {}

// String returns a string containing the original data
// with the queued edits applied.
func (b *Buffer) String() string {}