anyhelpers

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: MIT Imports: 1 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 Ptr

func Ptr[T any](v T) *T

Generic function to get the pointer of any type

Types

This section is empty.

Jump to

Keyboard shortcuts

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