crwriter

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CRWriter

type CRWriter struct {
	Out io.Writer
	// contains filtered or unexported fields
}

CRWriter is a writer that adds \r before each \n. Needed for raw mode terminals (and I guess also if you want something DOS or http headers like).

func (*CRWriter) Reset

func (c *CRWriter) Reset()

In case you want to ensure the memory used by the buffer is released.

func (*CRWriter) Write

func (c *CRWriter) Write(orig []byte) (n int, err error)

Optimized to avoid many small writes by buffering and only writing \r when needed. No extra syscall, relies on append() to efficiently reallocate the buffer.

Jump to

Keyboard shortcuts

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