util

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Atoi16

func Atoi16(str string) (int16, error)

Converts a string into an int16

func Atoi64

func Atoi64(str string) (int64, error)

Converts a string into an int64

func AtoiUint added in v0.1.3

func AtoiUint(str string) (uint, error)

func CheckErr

func CheckErr(err error)

Fatal when having an error

func CopyFile

func CopyFile(src, dest string) error

Copies a file from src to dest with file permission 0666. Returns an error.

func CriticalDirExist

func CriticalDirExist(dirName string)

Check whether a critical directory exists.

func CriticalFileExist

func CriticalFileExist(fileName string)

Check whether a critical file exists.

func DirExists

func DirExists(dirName string) bool

Check whether a directory exists. Returns true when the directory exists, otherwise false.

func FileExists

func FileExists(fileName string) bool

Check whether a file exists. Returns true when the file exists, otherwise false.

func I16toa

func I16toa(i int16) string

Converts an int16 into a string

func I64toa

func I64toa(i int64) string

Converts an int64 into a string

func IsNumber

func IsNumber(name string) bool

Returns true when the string is a number.

func Now

func Now() string

Now returns the time of now in the format "YYYY-MM-DD HH:MM:SS"

func SplitFileExtension

func SplitFileExtension(file string) (base, ext string)

func StringToSlice added in v0.1.3

func StringToSlice(input string) []string

Convert a string to a slice of strings

func Today

func Today() string

today returns the date of today in the format "YYYY-MM-DD".

Types

This section is empty.

Jump to

Keyboard shortcuts

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