fileutil

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadFromFile

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

ReadFromFile reads the contents of a specified file into memory and returns it as a byte slice. Returns an error if the file cannot be opened, read, or closed.

func WriteToFile

func WriteToFile(filename string, data []byte) error

WriteToFile writes the given byte data to a specified file. It creates or truncates the file, writes the data, flushes it to disk, and closes the file. Returns an error if any step fails.

Types

This section is empty.

Jump to

Keyboard shortcuts

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