osutil

package
v0.51.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectLineEnding added in v0.35.0

func DetectLineEnding(content string) (string, error)

DetectLineEnding detects a dominant line ending in the content.

func ReadAllLines

func ReadAllLines(
	fileName string,
	newlineChar string,
) ([]string, error)

ReadAllLines reads all lines from a file.

func WriteExistingFile added in v0.35.0

func WriteExistingFile(
	fileName string,
	data []byte,
) error

WriteExistingFile writes the byte array to an existing file.

func WriteLinesToExistingFile

func WriteLinesToExistingFile(
	fileName string,
	lines []string,
	newlineChar string,
) error

WriteLinesToExistingFile writes lines to an existing file.

Types

type ExitCode

type ExitCode int

ExitCode is a code for os.Exit()

const (
	ExitSuccess         ExitCode = iota
	ExitLintFailure              // Lint errors, exclusively.
	ExitInternalFailure          // All other errors: parsing, internal, runtime errors.
)

ExitCode constants.

Jump to

Keyboard shortcuts

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