utils

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopySlice added in v0.5.1

func CopySlice(values []interface{}) []interface{}

CopySlice copy slice struct

func Flatten added in v0.5.1

func Flatten(value interface{}) []interface{}

Flatten flattens a multi-dimensional array into a single level array:

func GetIF

func GetIF(condition bool, value interface{}, defaultValue interface{}) interface{}

GetIF if the condition is true return the given value, else return the default value

func IntHave added in v0.0.3

func IntHave(source []int, one int) bool

IntHave Contains method for a slice

func IntPtr

func IntPtr(value int) *int

IntPtr get the int value for the pointer

func IntVal

func IntVal(v *int, defaults ...int) int

IntVal get the int type pointers value

func InterfaceUnique added in v0.5.1

func InterfaceUnique(slice []interface{}) []interface{}

InterfaceUnique Returns unique items in a slice

func IsNil added in v0.5.1

func IsNil(value interface{}) bool

IsNil Check if an interface is nil

func IsNumeric added in v0.5.1

func IsNumeric(v interface{}) bool

IsNumeric determine if the given value is numberic

func MapFilp

func MapFilp(v interface{}) (interface{}, bool)

MapFilp flipping the given map

func PanicIF

func PanicIF(v interface{})

PanicIF if the given value is not nil then panic, else do nothing

func Println

func Println(v interface{})

Println pretty print var

func StringHave added in v0.0.3

func StringHave(source []string, one string) bool

StringHave Contains method for a slice

func StringPtr

func StringPtr(value string) *string

StringPtr get the string value for the pointer

func StringUnique added in v0.5.1

func StringUnique(slice []string) []string

StringUnique Returns unique items in a slice

func StringVal

func StringVal(v *string, defaults ...string) string

StringVal get the string type pointers value

Types

This section is empty.

Jump to

Keyboard shortcuts

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