Sphire Mantis' API Documentation
import "github.com/sphireinc/mantis/helper"
func AtoiWithDefault(value string, defaultValue int) int
AtoiWithDefault same as strconv.Atoi except only returns the value or a default value if nil
func Average[T IntFloat](args ...T) float64
Average calculates the average value of a set of numbers
func CelsiusToFahrenheit(degrees float32) float32
CelsiusToFahrenheit converts C to F
func Default[T comparable](originalVal T, defaultVal T) T
Default returns the defaultVal given if originalVal is empty/nil
func DeferFileClose(file *os.File)
DeferFileClose prevents non-closure file closing error
func FahrenheitToCelsius(degrees float32) float32
FahrenheitToCelsius converts F to C
func FromPtr[T any](original *T) T
FromPtr returns a pointer value for the value passed in.
func Reverse(s string) string
Reverse a string
func StringToBool(boolean string) bool
StringToBool same as strconv.ParseBool except hides the error (returns false)
func ToPtr[T any](original T) *T
ToPtr returns a pointer value for the value passed in.
IntFloat is an interface for numeric types
type IntFloat interface {
float32 | float64 | int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64
}
Generated by gomarkdoc