utils

package
Version: v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 24, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs(x int) int

Abs : returns the absolute value of x.

func CheckFloatVal

func CheckFloatVal(p *float64, name *float64)

CheckFloatVal : assign a value to a float if the assigning float is non zero

func CheckIntVal

func CheckIntVal(p *int, name *int)

CheckIntVal : assign a value to a int if the assigning int is non zero

func CheckStringVal

func CheckStringVal(p *string, name *string)

CheckStringVal : assign a value to a string if the assigning string is not empty

func FindInIntArray

func FindInIntArray(array []int, item int) (bool, int)

FindInIntArray : * return true if an array contains a string value * return index for this string value (-1 if value not found)

func FindInStringArray

func FindInStringArray(array []string, item string) (bool, int)

FindInStringArray : * return true if an array contains a string value * return index for this string value (-1 if value not found)

func FloatToString

func FloatToString(inputNum float64) string

FloatToString : * convert the float number passed, return a string

func IsFlagSet

func IsFlagSet(name string) (passed bool)

IsFlagSet : * Determine if a Flag has been passed to the applicaiton * return true if the flag has been called as a parameter to the app

func Max

func Max(x, y int) int

Max : returns the larger of x or y.

func MaxFloat

func MaxFloat(x, y float64) float64

MaxFloat : returns the larger of x or y.

func Min

func Min(x, y int) int

Min : returns the smaller of x or y.

func RecoverPanic

func RecoverPanic()

RecoverPanic : * Called after go panic, when a parameter is not found in the main function

func StopApp

func StopApp()

StopApp : Print out flag usage and Stop the application

func WriteFile

func WriteFile(fileLocation string)

WriteFile : * fileLocation string - pass in fileLocation * Setup the debug log file

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL