anyhelpers

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanonicalizeSlice

func CanonicalizeSlice(input any) (any, bool)

CanonicalizeSlice checks if the input is a slice and if all elements are of the same type. If so, it returns the slice or converts to a more specific slice type, otherwise returns the original slice.

func DetectAndReturnStringListIfPresent

func DetectAndReturnStringListIfPresent(input interface{}) ([]string, bool)

DetectAndReturnStringListIfPresent checks if the input interface{} is a slice with only string elements and returns the slice and a bool indicating if a string slice was found.

func IsNumber added in v0.0.8

func IsNumber(val any) bool

func IsString added in v0.0.8

func IsString(val any) bool

func ToFloat64 added in v0.0.8

func ToFloat64(val any) (float64, error)

func ToInt64 added in v0.0.8

func ToInt64(val any) (int64, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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