Documentation ¶
Index ¶
- func CmpBool(x, y any) int
- func Compare[T any](x, y T) int
- func CompareUnsafe(x, y any) int
- func Delete[S ~[]T, T any](x S, target T) S
- func Insert[S ~[]T, T any](x S, target T) S
- func ParseTag(tag string) (m map[string]string)
- func Search[S ~[]T, T any](x S, target T) (int, bool)
- func SearchFunc[F any, S ~[]T, T *F](x S, f func(T)) (int, bool)
- func Sort[S ~[]E, E any](x S)
- func StdCompare[T constraints.Ordered](x, y T) int
- type Slice
- type Tag
- type Tags
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareUnsafe ¶ added in v1.7.0
func SearchFunc ¶ added in v1.5.0
func StdCompare ¶ added in v1.7.0
func StdCompare[T constraints.Ordered](x, y T) int
Compare returns
-1 if x is less than y, 0 if x equals y, +1 if x is greater than y.
For floating-point types, a NaN is considered less than any non-NaN, a NaN is considered equal to a NaN, and -0.0 is equal to 0.0.
Types ¶
type Slice ¶
type Slice[T any] struct { // I stands for Items I []T // contains filtered or unexported fields }
func (*Slice[T]) MarshalJSON ¶ added in v1.7.0
Click to show internal directories.
Click to hide internal directories.