Help us shape the future of Go! Take the 2026 Go Developer Survey

utils

package module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2019 License: MIT Imports: 5 Imported by: 5

README

go-utils

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetExecutablePath

func GetExecutablePath() (string, error)

GetExecutablePath gets the path of the current executable.

func ParseConfig

func ParseConfig(model interface{}) error

ParseConfig reads a `config.json` file on the same directory as the executable and parses its JSON to the given model.

func SafeJoinPaths

func SafeJoinPaths(path1, path2 string) string

SafeJoinPaths joins `path1` and `path2` and applies the correct separator.

func StringToInt

func StringToInt(str string, defaultValue int) int

StringToInt converts a string to an int, and if the conversion fails, it uses the `defaultValue`.

Types

This section is empty.

Jump to

Keyboard shortcuts

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