utils

package
v0.51.2 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadFile

func ReadFile(filename string) (b []byte, err error)

ReadFile reads the file identified by filename and returns the contents. If filename is equal to "-", it will read from STDIN.

func ReadPasswordFromFile

func ReadPasswordFromFile(filename string) ([]byte, error)

ReadPasswordFromFile reads and returns the password from the given filename. The contents of the file will be trimmed at the right.

func WriteFile

func WriteFile(filename string, data []byte, perm os.FileMode) error

WriteFile writes data to a file named by filename. If the file does not exist, WriteFile creates it with permissions perm (before umask); otherwise WriteFile truncates it before writing.

It wraps os.WriteFile wrapping the errors.

Types

This section is empty.

Directories

Path Synopsis
Package utfbom implements the detection of the BOM (Unicode Byte Order Mark) and removing as necessary.
Package utfbom implements the detection of the BOM (Unicode Byte Order Mark) and removing as necessary.

Jump to

Keyboard shortcuts

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