Documentation ¶
Index ¶
- Variables
- func AppendFloat32(array []float32, element float32) []float32
- func AppendFloat64(array []float64, element float64) []float64
- func AppendInt(array []int, element int) []int
- func AppendInt32(array []int32, element int32) []int32
- func AppendInt64(list []int64, element int64) []int64
- func AppendString(array []string, element string) []string
- func CombinationsString(set []string, n int, joiner string) (subsets []string)
- func CombinationsStringMax(set []string, n int, joiner string) (subsets []string)
- func ConvertToFloat32(array interface{}) (Intify []float32, err error)
- func ConvertToFloat64(array interface{}) (Intify []float64, err error)
- func ConvertToInt(array interface{}) (Intify []int, err error)
- func ConvertToInt32(array interface{}) (Intify []int32, err error)
- func ConvertToInt64(array interface{}) (Intify []int64, err error)
- func ConvertToString(array interface{}) (stringfy []string, err error)
- func CountFloat32(list *[]float32, element float32) int
- func CountFloat64(list *[]float64, element float64) int
- func CountInt(list *[]int, element int) int
- func CountInt32(list *[]int32, element int32) int
- func CountInt64(list *[]int64, element int64) int
- func CountString(list *[]string, element string) int
- func ExtendFloat32(list *[]float32, another []float32) []float32
- func ExtendFloat64(list *[]float64, another []float64) []float64
- func ExtendInt(list *[]int, another []int) []int
- func ExtendInt32(list *[]int32, another []int32) []int32
- func ExtendInt64(list *[]int64, another []int64) []int64
- func ExtendString(list *[]string, another []string) []string
- func GCFFloat32(list *[]float32) (gcf float32, err error)
- func GCFFloat64(list *[]float64) (gcf float64, err error)
- func GCFInt(list *[]int) (gcf int, err error)
- func GCFInt32(list *[]int32) (gcf int32, err error)
- func GCFInt64(list *[]int64) (gcf int64, err error)
- func IndexOfFloat32(array *[]float32, element float32) int
- func IndexOfFloat64(array *[]float64, element float64) int
- func IndexOfInt(array *[]int, element int) int
- func IndexOfInt32(array *[]int32, element int32) int
- func IndexOfInt64(list *[]int64, element int64) int
- func IndexOfString(array *[]string, element string) int
- func InsertFloat32(list *[]float32, element float32, index int) *[]float32
- func InsertFloat64(list *[]float64, element float64, index int) *[]float64
- func InsertInt(list *[]int, element int, index int) *[]int
- func InsertInt32(list *[]int32, element int32, index int) *[]int32
- func InsertInt64(list *[]int64, element int64, index int) *[]int64
- func InsertString(list *[]string, element string, index int) *[]string
- func LCMFloat32(list *[]float32) (lcm float32, err error)
- func LCMFloat64(list *[]float64) (lcm float64, err error)
- func LCMInt(list *[]int) (lcm int, err error)
- func LCMInt32(list *[]int32) (lcm int32, err error)
- func LCMInt64(list *[]int64) (lcm int64, err error)
- func LastFloat32(list []float32) (float32, error)
- func LastFloat64(list []float64) (float64, error)
- func LastInt(array []int) (int, error)
- func LastInt32(list []int32) (int32, error)
- func LastInt64(list []int64) (int64, error)
- func LastString(array []string) (string, error)
- func ListDivideFloat32(list []float32, other []float32) (product []float32)
- func ListDivideFloat64(list []float64, other []float64) (product []float64)
- func ListDivideInt(list []int, other []int) (product []int)
- func ListDivideInt32(list []int32, other []int32) (product []int32)
- func ListDivideInt64(list []int64, other []int64) (product []int64)
- func ListDivideNoFloat32(list []float32, no float32) (product []float32)
- func ListDivideNoFloat64(list []float64, no float64) (product []float64)
- func ListDivideNoInt(list []int, no int) (product []int)
- func ListDivideNoInt32(list []int32, no int32) (product []int32)
- func ListDivideNoInt64(list []int64, no int64) (product []int64)
- func ListMultiplyFloat32(list []float32, other []float32) (product []float32)
- func ListMultiplyFloat64(list []float64, other []float64) (product []float64)
- func ListMultiplyInt(list []int, other []int) (product []int)
- func ListMultiplyInt32(list []int32, other []int32) (product []int32)
- func ListMultiplyInt64(list []int64, other []int64) (product []int64)
- func ListMultiplyNoFloat32(list []float32, no float32) (product []float32)
- func ListMultiplyNoFloat64(list []float64, no float64) (product []float64)
- func ListMultiplyNoInt(list []int, no int) (product []int)
- func ListMultiplyNoInt32(list []int32, no int32) (product []int32)
- func ListMultiplyNoInt64(list []int64, no int64) (product []int64)
- func ListSubtractFloat32(list []float32, other []float32) (sum []float32)
- func ListSubtractFloat64(list []float64, other []float64) (sum []float64)
- func ListSubtractInt(list []int, other []int) (sum []int)
- func ListSubtractInt32(list []int32, other []int32) (sum []int32)
- func ListSubtractInt64(list []int64, other []int64) (sum []int64)
- func ListSubtractNoFloat32(list []float32, no float32) (sum []float32)
- func ListSubtractNoFloat64(list []float64, no float64) (sum []float64)
- func ListSubtractNoInt(list []int, no int) (sum []int)
- func ListSubtractNoInt32(list []int32, no int32) (sum []int32)
- func ListSubtractNoInt64(list []int64, no int64) (sum []int64)
- func ListSumFloat32(list []float32, other []float32) (sum []float32)
- func ListSumFloat64(list []float64, other []float64) (sum []float64)
- func ListSumInt(list []int, other []int) (sum []int)
- func ListSumInt32(list []int32, other []int32) (sum []int32)
- func ListSumInt64(list []int64, other []int64) (sum []int64)
- func ListSumNoFloat32(list []float32, no float32) (sum []float32)
- func ListSumNoFloat64(list []float64, no float64) (sum []float64)
- func ListSumNoInt(list []int, no int) (sum []int)
- func ListSumNoInt32(list []int32, no int32) (sum []int32)
- func ListSumNoInt64(list []int64, no int64) (sum []int64)
- func MaxFloat32(list *[]float32) (max float32)
- func MaxFloat64(list *[]float64) (max float64)
- func MaxInt(list *[]int) (max int)
- func MaxInt32(list *[]int32) (max int32)
- func MaxInt64(list *[]int64) (max int64)
- func MaxString(list *[]string) (max string)
- func MinFloat32(list *[]float32) (min float32)
- func MinFloat64(list *[]float64) (min float64)
- func MinInt(list *[]int) (min int)
- func MinInt32(list *[]int32) (min int32)
- func MinInt64(list *[]int64) (min int64)
- func MinString(list *[]string) (min string)
- func PopFloat32(list *[]float32, index int) ([]float32, float32)
- func PopFloat64(list *[]float64, index int) ([]float64, float64)
- func PopInt(list *[]int, index int) ([]int, int)
- func PopInt32(list *[]int32, index int) ([]int32, int32)
- func PopInt64(list *[]int64, index int) ([]int64, int64)
- func PopString(list *[]string, index int) ([]string, string)
- func RemoveFloat32(list *[]float32, element float32) (*[]float32, error)
- func RemoveFloat64(list *[]float64, element float64) (*[]float64, error)
- func RemoveInt(list *[]int, element int) (*[]int, error)
- func RemoveInt32(list *[]int32, element int32) (*[]int32, error)
- func RemoveInt64(list *[]int64, element int64) (*[]int64, error)
- func RemoveString(list *[]string, element string) (*[]string, error)
- func ReverseFloat32(list *[]float32) *[]float32
- func ReverseFloat64(list *[]float64) *[]float64
- func ReverseInt(list *[]int) *[]int
- func ReverseInt32(list *[]int32) *[]int32
- func ReverseInt64(list *[]int64) *[]int64
- func ReverseString(list *[]string) *[]string
- func RoundFloat64(num float64, precision int) float64
- func SetFloat32(list []float32) (set []float32)
- func SetFloat64(list []float64) (set []float64)
- func SetInt(list []int) (set []int)
- func SetInt32(list []int32) (set []int32)
- func SetInt64(list []int64) (set []int64)
- func SetString(list []string) (set []string)
- func SortFloat32(list *[]float32, reverse bool) *[]float32
- func SortFloat64(list *[]float64, reverse bool) *[]float64
- func SortInt(list *[]int, reverse bool) *[]int
- func SortInt32(list *[]int32, reverse bool) *[]int32
- func SortInt64(list *[]int64, reverse bool) *[]int64
- func SortString(list *[]string, reverse bool) *[]string
- func SumFloat32(list *[]float32) (sum float32)
- func SumFloat64(list *[]float64) (sum float64)
- func SumInt(list *[]int) (sum int)
- func SumInt32(list *[]int32) (sum int32)
- func SumInt64(list *[]int64) (sum int64)
- func SumString(list *[]string) (sum string)
Constants ¶
This section is empty.
Variables ¶
var ( ErrNotZeroOrPositive = errors.New("numbers must be zero or positive") ErrNotInList = errors.New("element not in list") ErrListEmpty = errors.New("list is empty") ErrTypeNotSupported = errors.New("type not supported") )
Error variables that are common within the module
Functions ¶
func AppendFloat32 ¶
AppendFloat32 : implements append
func AppendFloat64 ¶
AppendFloat64 : implements append
func AppendInt32 ¶
AppendInt32 : implements append
func AppendInt64 ¶
AppendInt64 : implements append
func AppendString ¶
AppendString : implements append
func CombinationsString ¶ added in v1.1.6
CombinationsString : adapted from https://github.com/mxschmitt/golang-combinations
func CombinationsStringMax ¶ added in v1.3.0
CombinationsStringMax returns combinations of max length. For example: a list of [a, b, c] with max combination 2, should return 1 and 2 combinations. i.e combinations length <= n adapted from https://github.com/mxschmitt/golang-combinations
func ConvertToFloat32 ¶ added in v1.4.0
ConvertToFloat32 converts to slice to float32
func ConvertToFloat64 ¶ added in v1.4.0
ConvertToFloat64 converts to slice to float64
func ConvertToInt ¶ added in v1.4.0
ConvertToInt converts to slice to int
func ConvertToInt32 ¶ added in v1.4.0
ConvertToInt32 converts to slice to int32
func ConvertToInt64 ¶ added in v1.4.0
ConvertToInt64 converts to slice to int64
func ConvertToString ¶ added in v1.4.0
ConvertToString converts to a specified list type
func CountFloat32 ¶
CountFloat32 : returns the number of times a given element appears in a slice
func CountFloat64 ¶
CountFloat64 : returns the number of times a given element appears in a slice
func CountInt32 ¶
CountInt32 : returns the number of times a given element appears in a slice
func CountInt64 ¶
CountInt64 : returns the number of times a given element appears in a slice
func CountString ¶
CountString : returns the number of times a given element appears in a slice
func ExtendFloat32 ¶
ExtendFloat32 : adds two slice together
func ExtendFloat64 ¶
ExtendFloat64 : adds two slice together
func ExtendInt32 ¶
ExtendInt32 : adds two slice together
func ExtendInt64 ¶
ExtendInt64 : adds two slice together
func ExtendString ¶
ExtendString : adds two slice together
func GCFFloat32 ¶ added in v1.1.5
GCFFloat32 : returns greatest common factor of slice
func GCFFloat64 ¶ added in v1.1.5
GCFFloat64 : helper function for gcf
func IndexOfFloat32 ¶
IndexOfFloat32 : returns index of element. returns -1 if element dont exist
func IndexOfFloat64 ¶
IndexOfFloat64 : returns index of element. returns -1 if element dont exist
func IndexOfInt ¶
IndexOfInt : returns index of element. returns -1 if element dont exist
func IndexOfInt32 ¶
IndexOfInt32 : returns index of element. returns -1 if element dont exist
func IndexOfInt64 ¶
IndexOfInt64 : returns index of element. returns -1 if element dont exist
func IndexOfString ¶
IndexOfString : returns index of element. returns -1 if element dont exist
func InsertFloat32 ¶
InsertFloat32 : insert an element in a given position
func InsertFloat64 ¶
InsertFloat64 : insert an element in a given position
func InsertInt32 ¶
InsertInt32 : insert an element in a given position
func InsertInt64 ¶
InsertInt64 : insert an element in a given position
func InsertString ¶
InsertString : insert an element in a given position
func LCMFloat32 ¶ added in v1.1.5
LCMFloat32 : returns lowest common multiple of slice
func LCMFloat64 ¶ added in v1.1.5
LCMFloat64 : returns lowest common multiple of slice
func LastFloat32 ¶
LastFloat32 : return last element in slice
func LastFloat64 ¶
LastFloat64 : return last element in slice
func LastString ¶
LastString : return last element in slice
func ListDivideFloat32 ¶ added in v1.4.0
ListDivideFloat32 divide the contents of two lists
func ListDivideFloat64 ¶ added in v1.4.0
ListDivideFloat64 divide the contents of two lists
func ListDivideInt ¶ added in v1.4.0
ListDivideInt divide the contents of two lists
func ListDivideInt32 ¶ added in v1.4.0
ListDivideInt32 divide the contents of two lists
func ListDivideInt64 ¶ added in v1.4.0
ListDivideInt64 divide the contents of two lists
func ListDivideNoFloat32 ¶ added in v1.4.0
ListDivideNoFloat32 divide a given number with all elements in list
func ListDivideNoFloat64 ¶ added in v1.4.0
ListDivideNoFloat64 divide a given number with all elements in list
func ListDivideNoInt ¶ added in v1.4.0
ListDivideNoInt divide a given number with all elements in list
func ListDivideNoInt32 ¶ added in v1.4.0
ListDivideNoInt32 divide a given number with all elements in list
func ListDivideNoInt64 ¶ added in v1.4.0
ListDivideNoInt64 divide a given number with all elements in list
func ListMultiplyFloat32 ¶ added in v1.4.0
ListMultiplyFloat32 multiply contents of two lists
func ListMultiplyFloat64 ¶ added in v1.4.0
ListMultiplyFloat64 multiply contents of two lists
func ListMultiplyInt ¶ added in v1.4.0
ListMultiplyInt multiply contents of two lists
func ListMultiplyInt32 ¶ added in v1.4.0
ListMultiplyInt32 multiply contents of two lists
func ListMultiplyInt64 ¶ added in v1.4.0
ListMultiplyInt64 multiply contents of two lists
func ListMultiplyNoFloat32 ¶ added in v1.4.0
ListMultiplyNoFloat32 multiply a given number with all elements in list
func ListMultiplyNoFloat64 ¶ added in v1.4.0
ListMultiplyNoFloat64 multiply a given number with all elements in list
func ListMultiplyNoInt ¶ added in v1.4.0
ListMultiplyNoInt multiply a given number with all elements in list
func ListMultiplyNoInt32 ¶ added in v1.4.0
ListMultiplyNoInt32 multiply a given number with all elements in list
func ListMultiplyNoInt64 ¶ added in v1.4.0
ListMultiplyNoInt64 multiply a given number with all elements in list
func ListSubtractFloat32 ¶ added in v1.4.0
ListSubtractFloat32 subtracts the contents of two lists
func ListSubtractFloat64 ¶ added in v1.4.0
ListSubtractFloat64 subtracts the contents of two lists
func ListSubtractInt ¶ added in v1.4.0
ListSubtractInt subtracts the contents of two lists
func ListSubtractInt32 ¶ added in v1.4.0
ListSubtractInt32 subtracts the contents of two lists
func ListSubtractInt64 ¶ added in v1.4.0
ListSubtractInt64 subtracts the contents of two lists
func ListSubtractNoFloat32 ¶ added in v1.4.0
ListSubtractNoFloat32 subtracts an element from the contents a list
func ListSubtractNoFloat64 ¶ added in v1.4.0
ListSubtractNoFloat64 subtracts an element from the contents a list
func ListSubtractNoInt ¶ added in v1.4.0
ListSubtractNoInt subtracts an element from the contents a list
func ListSubtractNoInt32 ¶ added in v1.4.0
ListSubtractNoInt32 subtracts an element from the contents a list
func ListSubtractNoInt64 ¶ added in v1.4.0
ListSubtractNoInt64 subtracts an element from the contents a list
func ListSumFloat32 ¶ added in v1.4.0
ListSumFloat32 sums contents of two lists
func ListSumFloat64 ¶ added in v1.4.0
ListSumFloat64 sums contents of two lists
func ListSumInt ¶ added in v1.4.0
ListSumInt sums contents of two lists
func ListSumInt32 ¶ added in v1.4.0
ListSumInt32 sums contents of two lists
func ListSumInt64 ¶ added in v1.4.0
ListSumInt64 sums contents of two lists
func ListSumNoFloat32 ¶ added in v1.4.0
ListSumNoFloat32 sums contents of two lists
func ListSumNoFloat64 ¶ added in v1.4.0
ListSumNoFloat64 sums contents of two lists
func ListSumNoInt ¶ added in v1.4.0
ListSumNoInt sums contents of two lists
func ListSumNoInt32 ¶ added in v1.4.0
ListSumNoInt32 sums contents of two lists
func ListSumNoInt64 ¶ added in v1.4.0
ListSumNoInt64 sums contents of two lists
func MaxFloat32 ¶ added in v1.1.4
MaxFloat32 : returns max element in slice
func MaxFloat64 ¶ added in v1.1.4
MaxFloat64 : returns max element in slice
func MinFloat32 ¶ added in v1.1.4
MinFloat32 : returns min element in slice
func MinFloat64 ¶ added in v1.1.4
MinFloat64 : returns min element in slice
func PopFloat32 ¶
PopFloat32 : removes element from slice
func PopFloat64 ¶
PopFloat64 : removes element from slice
func RemoveFloat32 ¶
RemoveFloat32 : removes given element from slice
func RemoveFloat64 ¶
RemoveFloat64 : removes given element from slice
func RemoveInt32 ¶
RemoveInt32 : removes given element from slice
func RemoveInt64 ¶
RemoveInt64 : removes given element from slice
func RemoveString ¶
RemoveString : removes given element from slice
func ReverseFloat32 ¶
ReverseFloat32 : reverse the positions of elements in slice
func ReverseFloat64 ¶
ReverseFloat64 : reverse the positions of elements in slice
func ReverseInt ¶
ReverseInt : reverse the positions of elements in slice
func ReverseInt32 ¶
ReverseInt32 : reverse the positions of elements in slice
func ReverseInt64 ¶
ReverseInt64 : reverse the positions of elements in slice
func ReverseString ¶
ReverseString : reverse the positions of elements in slice
func RoundFloat64 ¶ added in v1.1.5
RoundFloat64 : rounds float with a precision
func SetFloat32 ¶ added in v1.1.6
SetFloat32 : returns a set of slice i.e removes duplicates
func SetFloat64 ¶ added in v1.1.6
SetFloat64 : returns a set of slice i.e removes duplicates
func SortFloat32 ¶
SortFloat32 : sorts slice
func SortFloat64 ¶
SortFloat64 : sorts slice
func SumFloat32 ¶ added in v1.1.3
SumFloat32 : sum of elements in slice
func SumFloat64 ¶ added in v1.1.3
SumFloat64 : sum of elements in slice
Types ¶
This section is empty.