crlf

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

The crlf package helps in dealing with files that have DOS-style CR/LF line endings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewReader

func NewReader(r io.Reader) io.Reader

NewReader returns an io.Reader that converts CR or CRLF line endings to LF.

func NewWriter

func NewWriter(w io.Writer) io.Writer

NewWriter returns an io.Writer that converts LF line endings to CRLF.

Types

type Normalize

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

Normalize takes CRLF, CR, or LF line endings in src, and converts them to LF in dst.

func (*Normalize) Reset

func (n *Normalize) Reset()

func (*Normalize) Transform

func (n *Normalize) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error)

type ToCRLF

type ToCRLF struct{}

ToCRLF takes LF line endings in src, and converts them to CRLF in dst.

func (ToCRLF) Reset

func (ToCRLF) Reset()

func (ToCRLF) Transform

func (ToCRLF) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error)

Jump to

Keyboard shortcuts

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