files

package
v0.0.0-...-8e4dac2 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Files package contains functions to search and read files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBytesFromPath

func GetBytesFromPath(path string) ([]byte, int, error)

GetBytesFromPath returns the content of the given file as []byte and its length. If an error occurs, it is returned instead.

func SearchConfigFile

func SearchConfigFile(modname, fileext string) (string, error)

SearchConfigFile searches for config files named <modname>.<fileext> in the following locations

  1. current working directory
  2. <user specific config directory (most ~/.config)>/<modname>
  3. /usr/local/etc/<modname>
  4. /etc/<modname>

The first existing file is returned. If none is found, an error is returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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