utils

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: MIT, 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 any) float64

Compare returns the float value of x minus y

func IsNil

func IsNil(x any) (bool, bool)

IsNil returns true, true if the value is nilable and is nil.

func SmartCompare

func SmartCompare(x, y any) 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

func ToInterfaces(vs []reflect.Value) []any

ToInterfaces convertor

func ToValues

func ToValues(vs []any) []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