Help us shape the future of Go! Take the 2026 Go Developer Survey

utils

package
v0.43.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 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 IsNil added in v0.35.0

func IsNil(x interface{}) (bool, bool)

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

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