convert

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2020 License: MIT Imports: 5 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool added in v0.0.5

func Bool(v bool) *bool

Bool returns a pointer to the bool value passed in.

func BoolMap added in v0.0.5

func BoolMap(src map[string]bool) map[string]*bool

BoolMap converts a string map of bool values into a string map of bool pointers

func BoolSlice added in v0.0.5

func BoolSlice(src []bool) []*bool

BoolSlice converts a slice of bool values into a slice of bool pointers

func BoolValue added in v0.0.5

func BoolValue(v *bool) bool

BoolValue returns the value of the bool pointer passed in or false if the pointer is nil.

func BoolValueMap added in v0.0.5

func BoolValueMap(src map[string]*bool) map[string]bool

BoolValueMap converts a string map of bool pointers into a string map of bool values

func BoolValueSlice added in v0.0.5

func BoolValueSlice(src []*bool) []bool

BoolValueSlice converts a slice of bool pointers into a slice of bool values

func Float64 added in v0.0.5

func Float64(v float64) *float64

Float64 returns a pointer to the float64 value passed in.

func Float64Map added in v0.0.5

func Float64Map(src map[string]float64) map[string]*float64

Float64Map converts a string map of float64 values into a string map of float64 pointers

func Float64Slice added in v0.0.5

func Float64Slice(src []float64) []*float64

Float64Slice converts a slice of float64 values into a slice of float64 pointers

func Float64Value added in v0.0.5

func Float64Value(v *float64) float64

Float64Value returns the value of the float64 pointer passed in or 0 if the pointer is nil.

func Float64ValueMap added in v0.0.5

func Float64ValueMap(src map[string]*float64) map[string]float64

Float64ValueMap converts a string map of float64 pointers into a string map of float64 values

func Float64ValueSlice added in v0.0.5

func Float64ValueSlice(src []*float64) []float64

Float64ValueSlice converts a slice of float64 pointers into a slice of float64 values

func Int added in v0.0.4

func Int(v int) *int

Int returns a pointer to the int value passed in.

func IntMap added in v0.0.5

func IntMap(src map[string]int) map[string]*int

IntMap converts a string map of int values into a string map of int pointers

func IntSlice added in v0.0.5

func IntSlice(src []int) []*int

IntSlice converts a slice of int values into a slice of int pointers

func IntValue added in v0.0.4

func IntValue(v *int) int

IntValue returns the value of the string pointer passed in or "" if the pointer is nil.

func IntValueMap added in v0.0.5

func IntValueMap(src map[string]*int) map[string]int

IntValueMap converts a string map of int pointers into a string map of int values

func IntValueSlice added in v0.0.5

func IntValueSlice(src []*int) []int

IntValueSlice converts a slice of int pointers into a slice of int values

func MD5Hash added in v0.0.3

func MD5Hash(text string) string

MD5Hash for md5 hash string

func String added in v0.0.3

func String(v string) *string

String returns a pointer to the string value passed in.

func StringMap added in v0.0.5

func StringMap(src map[string]string) map[string]*string

StringMap converts a string map of string values into a string map of string pointers

func StringSlice added in v0.0.5

func StringSlice(src []string) []*string

StringSlice converts a slice of string values into a slice of string pointers

func StringValue added in v0.0.3

func StringValue(v *string) string

StringValue returns the value of the string pointer passed in or "" if the pointer is nil.

func StringValueMap added in v0.0.5

func StringValueMap(src map[string]*string) map[string]string

StringValueMap converts a string map of string pointers into a string map of string values

func StringValueSlice added in v0.0.5

func StringValueSlice(src []*string) []string

StringValueSlice converts a slice of string pointers into a slice of string values

func ToBool

func ToBool(value interface{}) interface{}

ToBool convert any type to boolean

func ToFloat

func ToFloat(value interface{}) interface{}

ToFloat convert any type to float

func ToInt

func ToInt(value interface{}) interface{}

ToInt convert any type to int

func ToString

func ToString(value interface{}) interface{}

ToString convert any type to string

Types

This section is empty.

Jump to

Keyboard shortcuts

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