dfunc

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AndroidSetTimeZone

func AndroidSetTimeZone()

func Assert

func Assert(guard bool, text string)

func GetPointer

func GetPointer[T any](v T) *T

GetPointer 获得指定值的指针

func Min

func Min[T ~int | ~int8 | ~int16 | ~int32 | ~int64](v1, v2 T) T

func NewWaitGroup

func NewWaitGroup(maxConcurrent, count int) *waitGroup

NewWaitGroup maxConcurrent最大并发,count总数

func PointerSafeGetter

func PointerSafeGetter[T any](v1 *T, dv T) T

PointerSafeGetter 空指针安全判定获取值

func Select

func Select[T any](condition int, values ...T) T

Select 选择输出

func SliceUnique

func SliceUnique[T comparable](s *[]T)

SliceUnique slice去重

func Sort

func Sort[T any](s []T, less func(T, T) bool)

func Stack

func Stack(skip int) []byte

func TernaryOperator

func TernaryOperator[T any](condition bool, trueValue, falseValue T) T

TernaryOperator 三目运算

func TernaryOperatorFunc

func TernaryOperatorFunc[T any](condition bool, trueValueFunc, falseValueFunc func() T) T

TernaryOperatorFunc 三目函数运算

func TestingHandlerError

func TestingHandlerError(t *testing.T, err error)

func TestingHandlerErrorWithValue

func TestingHandlerErrorWithValue[T any](t *testing.T, getter func() (T, error)) T

Types

This section is empty.

Jump to

Keyboard shortcuts

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