Documentation ¶
Index ¶
- func BitCountUint32(i uint32) uint32
- func BitCountUint64(i uint64) int
- func Contain[T constraints.Ordered](container []T, target T) bool
- func Copy[T any](src []T) []T
- func ElementEqual[T comparable](a []T, b []T) bool
- func EmbeddedSliceEqual[T comparable](a [][]T, b [][]T) bool
- func InInts(nums []int, target int) bool
- func Max[T constraints.Ordered](x, y T) T
- func Min[T constraints.Ordered](x, y T) T
- func PanicHelper(t *testing.T, fn func(), shouldPanic bool)
- func ShouldNotPanic(t *testing.T, fn func())
- func ShouldPanic(t *testing.T, fn func())
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BitCountUint32 ¶
BitCountUint32 Returns the number of one-bits of the specified uint32 value.
func BitCountUint64 ¶
BitCountUint64 Returns the number of one-bits of the specified uint64 value.
func Contain ¶
func Contain[T constraints.Ordered](container []T, target T) bool
Contain returns true if target is the element of container.
func Copy ¶
func Copy[T any](src []T) []T
Copy returns the copy of given slice. Maybe shallow copy depending on the type T, eg: pointer or map
func ElementEqual ¶
func ElementEqual[T comparable](a []T, b []T) bool
ElementEqual 查看两个slice是否元素相同,不区分元素顺序
func EmbeddedSliceEqual ¶
func EmbeddedSliceEqual[T comparable](a [][]T, b [][]T) bool
EmbeddedSliceEqual 判断内嵌的slice是否相同,不区分元素顺序
func PanicHelper ¶
PanicHelper wraps panic branch
func ShouldNotPanic ¶
ShouldNotPanic will report test error if panic
func ShouldPanic ¶
ShouldPanic will report test error if not panic
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.