Documentation
¶
Overview ¶
Package gutils Author: hyphen Copyright 2023 hyphen. All rights reserved. Create-time: 2023/12/4
Package gutils Create-time: 2024/12/24
Index ¶
- func FastAssert[T any](v any) T
- func MustDo[K, V any](key K, fc func(K) (V, error)) V
- func MustDoCtx[K, V any](ctx context.Context, key K, fc func(context.Context, K) (V, error)) V
- func MustEasyDo[V any](fc func() (V, error)) V
- func NoError[T any](t T) (T, error)
- func Paging[T any](arr []T, offset, limit int) []T
- func TernaryForm[T any](cond bool, tureVal, falseVal T) T
- type Pair
- type SafeChan
- type SliceSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FastAssert ¶
func MustEasyDo ¶
func TernaryForm ¶
Types ¶
type SafeChan ¶
type SafeChan[T any] struct { // contains filtered or unexported fields }
func NewSafeChan ¶
type SliceSet ¶ added in v0.3.0
type SliceSet[K comparable, V any] struct { // contains filtered or unexported fields }
func NewSliceSet ¶ added in v0.3.0
func NewSliceSet[K comparable, V any]() *SliceSet[K, V]
func NewSliceSetFormSlice ¶ added in v0.3.0
func NewSliceSetFormSlice[K comparable](ss ...[]K) *SliceSet[K, K]
Click to show internal directories.
Click to hide internal directories.