Documentation
¶
Index ¶
- func Bool(v bool) *bool
- func BoolMap(src map[string]bool) map[string]*bool
- func BoolSlice(src []bool) []*bool
- func BoolValue(v *bool) bool
- func BoolValueMap(src map[string]*bool) map[string]bool
- func BoolValueSlice(src []*bool) []bool
- func ByteToFloat64(bytes []byte) float64
- func ConvertBig5ToUTF8(s string) string
- func Float64(v float64) *float64
- func Float64Map(src map[string]float64) map[string]*float64
- func Float64Slice(src []float64) []*float64
- func Float64ToByte(f float64) []byte
- func Float64Value(v *float64) float64
- func Float64ValueMap(src map[string]*float64) map[string]float64
- func Float64ValueSlice(src []*float64) []float64
- func FromPtr[T any](ptr *T) T
- func Int(v int) *int
- func Int64(v int64) *int64
- func Int64Map(src map[string]int64) map[string]*int64
- func Int64Slice(src []int64) []*int64
- func Int64Value(v *int64) int64
- func Int64ValueMap(src map[string]*int64) map[string]int64
- func Int64ValueSlice(src []*int64) []int64
- func IntMap(src map[string]int) map[string]*int
- func IntSlice(src []int) []*int
- func IntValue(v *int) int
- func IntValueMap(src map[string]*int) map[string]int
- func IntValueSlice(src []*int) []int
- func MD5Hash(text string) string
- func SnakeCasedName(name string) string
- func String(v string) *string
- func StringMap(src map[string]string) map[string]*string
- func StringSlice(src []string) []*string
- func StringValue(v *string) string
- func StringValueMap(src map[string]*string) map[string]string
- func StringValueSlice(src []*string) []string
- func TitleCasedName(name string) string
- func ToBool(value interface{}) bool
- func ToFloat(value interface{}) interface{}
- func ToInt(value interface{}) interface{}
- func ToPtr[T any](value T) *T
- func ToString(value interface{}) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BoolMap ¶ added in v0.0.5
BoolMap converts a string map of bool values into a string map of bool pointers
func BoolSlice ¶ added in v0.0.5
BoolSlice converts a slice of bool values into a slice of bool pointers
func BoolValue ¶ added in v0.0.5
BoolValue returns the value of the bool pointer passed in or false if the pointer is nil.
func BoolValueMap ¶ added in v0.0.5
BoolValueMap converts a string map of bool pointers into a string map of bool values
func BoolValueSlice ¶ added in v0.0.5
BoolValueSlice converts a slice of bool pointers into a slice of bool values
func ByteToFloat64 ¶ added in v0.1.0
ByteToFloat64 convert byte to float64
func ConvertBig5ToUTF8 ¶ added in v0.2.1
ConvertBig5ToUTF8 converts a string encoded in Big5 to UTF-8 encoding. It takes a string `s` as input and returns the UTF-8 encoded string. If an error occurs during the conversion, it prints an error message and returns the original string.
Parameters:
- s: The input string encoded in Big5.
Returns:
- The UTF-8 encoded string, or the original string if an error occurs.
func Float64Map ¶ added in v0.0.5
Float64Map converts a string map of float64 values into a string map of float64 pointers
func Float64Slice ¶ added in v0.0.5
Float64Slice converts a slice of float64 values into a slice of float64 pointers
func Float64ToByte ¶ added in v0.1.0
Float64ToByte convert float64 to byte ref: https://stackoverflow.com/questions/43693360/convert-float64-to-byte-array
func Float64Value ¶ added in v0.0.5
Float64Value returns the value of the float64 pointer passed in or 0 if the pointer is nil.
func Float64ValueMap ¶ added in v0.0.5
Float64ValueMap converts a string map of float64 pointers into a string map of float64 values
func Float64ValueSlice ¶ added in v0.0.5
Float64ValueSlice converts a slice of float64 pointers into a slice of float64 values
func FromPtr ¶ added in v0.3.0
func FromPtr[T any](ptr *T) T
FromPtr takes a pointer to a value and returns the value itself. If the pointer is nil, it returns the zero value of the type.
T: The type of the value being dereferenced. ptr: The pointer to the value.
Returns the value pointed to by the pointer, or the zero value if the pointer is nil.
func Int64Map ¶ added in v0.0.6
Int64Map converts a string map of int64 values into a string map of int64 pointers
func Int64Slice ¶ added in v0.0.6
Int64Slice converts a slice of int64 values into a slice of int64 pointers
func Int64Value ¶ added in v0.0.6
Int64Value returns the value of the int64 pointer passed in or 0 if the pointer is nil.
func Int64ValueMap ¶ added in v0.0.6
Int64ValueMap converts a string map of int64 pointers into a string map of int64 values
func Int64ValueSlice ¶ added in v0.0.6
Int64ValueSlice converts a slice of int64 pointers into a slice of int64 values
func IntMap ¶ added in v0.0.5
IntMap converts a string map of int values into a string map of int pointers
func IntSlice ¶ added in v0.0.5
IntSlice converts a slice of int values into a slice of int pointers
func IntValue ¶ added in v0.0.4
IntValue returns the value of the string pointer passed in or "" if the pointer is nil.
func IntValueMap ¶ added in v0.0.5
IntValueMap converts a string map of int pointers into a string map of int values
func IntValueSlice ¶ added in v0.0.5
IntValueSlice converts a slice of int pointers into a slice of int values
func SnakeCasedName ¶ added in v0.0.9
SnakeCasedName convert String into Snake Case ex: FooBar -> foo_bar
func StringMap ¶ added in v0.0.5
StringMap converts a string map of string values into a string map of string pointers
func StringSlice ¶ added in v0.0.5
StringSlice converts a slice of string values into a slice of string pointers
func StringValue ¶ added in v0.0.3
StringValue returns the value of the string pointer passed in or "" if the pointer is nil.
func StringValueMap ¶ added in v0.0.5
StringValueMap converts a string map of string pointers into a string map of string values
func StringValueSlice ¶ added in v0.0.5
StringValueSlice converts a slice of string pointers into a slice of string values
func TitleCasedName ¶ added in v0.0.9
TitleCasedName convert String into title cased ex: foo_bar -> FooBar
func ToPtr ¶ added in v0.2.0
func ToPtr[T any](value T) *T
ToPtr takes a value of any type and returns a pointer to that value. This is useful for converting a value to a pointer in a generic way.
T: The type of the value being converted. value: The value to be converted to a pointer.
Returns a pointer to the provided value.
Types ¶
This section is empty.