utils

package
v0.16.12 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2021 License: GPL-3.0 Imports: 9 Imported by: 9

Documentation

Overview

Package utils contains utility functions that are used everywhere in the app.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllFilesIn

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

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 outputted to logs. Used in unit tests.

func CoreExt

func CoreExt() string

CoreExt returns the libretro core extension for the current OS

func DatedName added in v0.4.1

func DatedName(path string) string

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

func FileName(path string) string

FileName returns the name of a file, without the path and extension.

func IndexOfString added in v0.5.2

func IndexOfString(element string, data []string) int

IndexOfString returns the index of a string in a string slice

func LinesInFile

func LinesInFile(r io.Reader) (int, error)

LinesInFile counts the number of lines in a file

func StringInSlice

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

StringInSlice check wether a string is contain in a string slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

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