Documentation
¶
Index ¶
- func ChunkSlice[T any](slice []T, chunkSize int) [][]T
- func CompareAsFloat64(a, b any) bool
- func ExpandHomeDir(pathStr string) (string, error)
- func ExpandHomeDirSafe(pathStr string) string
- func FromFloat64[T any](val float64) (T, bool)
- func GetHomeDir() string
- func GetTypedAtomValue[T any](rawVal any, atomName string) T
- func IsNumericType(val any) bool
- func JsonValEqual(a, b any) bool
- func MapToStruct(in map[string]any, out any) error
- func NumToString[T any](value T) (string, bool)
- func OpenBrowser(url string, delay time.Duration)
- func PanicHandler(debugStr string, recoverVal any) error
- func StructToMap(in any) (map[string]any, error)
- func ToFloat64(val any) (float64, bool)
- func ToInt(val any) (int, bool)
- func ToInt64(val any) (int64, bool)
- func ValidateAtomType(t reflect.Type, atomName string) error
- type JsonFieldInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChunkSlice ¶
func CompareAsFloat64 ¶
Helper to handle numeric comparisons as float64
func ExpandHomeDir ¶
func ExpandHomeDirSafe ¶
func FromFloat64 ¶
FromFloat64 converts a float64 to the specified numeric type T Returns the converted value and a bool indicating if the conversion was successful
func GetHomeDir ¶
func GetHomeDir() string
func GetTypedAtomValue ¶
func JsonValEqual ¶
this is a shallow equal, but with special handling for numeric types it will up convert to float64 and compare
func NumToString ¶
func OpenBrowser ¶
func PanicHandler ¶
PanicHandler handles panic recovery and logging. It can be called directly with recover() without checking for nil first. Example usage:
defer func() {
util.PanicHandler("operation name", recover())
}()
Types ¶
type JsonFieldInfo ¶
func ParseJSONTag ¶
func ParseJSONTag(field reflect.StructField) (JsonFieldInfo, bool)
Click to show internal directories.
Click to hide internal directories.