types

package
v0.0.0-...-b51443a Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvMapToSlice

func ConvMapToSlice(m interface{}, s interface{})

ConvMapToSlice convert map to slice, m must be map, s must be slice ptr

func ConvSliceToLookupTable

func ConvSliceToLookupTable(s interface{}) map[interface{}]bool

ConvSliceToLookupTable convert slice to look up table

func ConvSliceToMap

func ConvSliceToMap(s interface{}, m interface{})

ConvSliceToMap,s must be slice, and slice item must be Key() and Value() method, m must be map[Key()]Value() if args does not conform to specification, will panic

func ElemType

func ElemType(i interface{}) reflect.Type

func ElemValue

func ElemValue(i interface{}) reflect.Value

func FieldNames

func FieldNames(i interface{}) []string

func FieldValues

func FieldValues(i interface{}) []interface{}

func IsNil

func IsNil(i interface{}) bool

func IsTypeInitValue

func IsTypeInitValue(i interface{}) bool

func MergeMaps

func MergeMaps(out interface{}, ms ...interface{})

MergeMaps merge maps, the map key -> value must be have Merge method

func SlicePluck

func SlicePluck(s0 interface{}, fieldName string, s1 interface{}) error

SlicePluck slice elem one filedName

s0 := []struct{
    Name string
    Gender int
  }{...}

var s1 []int SlicePluck(s0, "Gender", &s1)

func Strings

func Strings(s interface{}) ([]string, error)

s is slice, convert strings and sort

func SumSlice

func SumSlice(s interface{}, m interface{})

SumSlice sum Slice, s is slice, item have Key() and Value() value method, the value have Sum Method

func ToMap

func ToMap(i interface{}) map[interface{}]interface{}

func ToSlice

func ToSlice(i interface{}) []interface{}

Types

This section is empty.

Jump to

Keyboard shortcuts

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