utils

package
v0.34.2 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package utils ...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compare

func Compare(x, y interface{}) float64

Compare returns the float value of x minus y

func MethodType added in v0.26.0

func MethodType(target interface{}, method string) reflect.Type

MethodType of target method

func SmartCompare added in v0.23.0

func SmartCompare(x, y interface{}) float64

SmartCompare returns the float value of x minus y. If x and y are numerical types, the result will be the subtraction between them, such as x is int(1), y is float64(1.2), the result will be -0.2 . time.Time is also a numerical value. If x or y are not numerical types, both of them will be converted to string format of its value type, the result will be the strings.Compare result between them, such as x is int(1), y is "a", the result will be 1 .

func ToInterfaces added in v0.26.0

func ToInterfaces(vs []reflect.Value) []interface{}

ToInterfaces convertor

func ToValues added in v0.26.0

func ToValues(vs []interface{}) []reflect.Value

ToValues convertor

Types

This section is empty.

Jump to

Keyboard shortcuts

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