util

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exists

func Exists(name string) bool

Exists reports whether the named file or directory exists.

func GetSha256

func GetSha256(b []byte) string

GetSha256 returns SHA256 hash.

func MkDir

func MkDir(name string) bool

MkDir create a directory if it does not exists.

func ReadAll

func ReadAll(filePath string) ([]byte, error)

ReadAll reads the entire file into memory.

func StringInSlice

func StringInSlice(a string, list []string) bool

StringInSlice returns whether or not a string exists in a slice.

func UniqueSlice

func UniqueSlice(slice []string) []string

UniqueSlice delete duplicate strings from an array of strings.

func UserHomeDir

func UserHomeDir() string

func WalkAllFilesInDir

func WalkAllFilesInDir(dir string) ([]string, error)

WalkAllFilesInDir returns list of files in directory.

func WriteBytesFile

func WriteBytesFile(filename string, r io.Reader) (int, error)

WriteBytesFile write Bytes to a File.

Types

This section is empty.

Jump to

Keyboard shortcuts

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