Documentation ¶
Overview ¶
Package utils contains utility functions that are used everywhere in the app.
Index ¶
- func AllFilesIn(dir string) []string
- func CaptureOutput(f func()) string
- func CoreExt() string
- func DatedName(path string) string
- func FileName(path string) string
- func IndexOfString(element string, data []string) int
- func LinesInFile(r io.Reader) (int, error)
- func StringInSlice(a string, list []string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllFilesIn ¶
AllFilesIn recursively builds a list of the files in a given directory
func CaptureOutput ¶
func CaptureOutput(f func()) string
CaptureOutput executes a function and capture all the text outputed to logs. Used in unit tests.
func DatedName ¶ added in v0.4.1
DatedName returns the name of a file with a date appended, without extension. It is used for savestates and screenshot names.
func FileName ¶ added in v0.4.1
FileName returns the name of a file, without the path and extension.
func IndexOfString ¶ added in v0.5.2
IndexOfString returns the index of a string in a string slice or -1 if not found.
func LinesInFile ¶
LinesInFile counts the number of lines in a file
func StringInSlice ¶
StringInSlice check wether a string is contain in a string slice.
Types ¶
This section is empty.