sliceutil

package
v0.0.0-...-a0062ce Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteSlice

func DeleteSlice[T int | string | int32 | int64](s []T, elem T) []T

func FindInt

func FindInt(slice []int, target int) bool

FindInt return true if target in slice, return false if not.

func FindString

func FindString(slice []string, target string) bool

FindString return true if target in slice, return false if not.

func FindUint

func FindUint(slice []uint, target uint) bool

FindUint return true if target in slice, return false if not.

func HasIn

func HasIn[T int | string | int32 | int64](value T, allows []T) bool

HasIn [T int | string | int32 | int64]

@Description: 判断一个值是否在列表中
@param value :需要判断的值
@param allows : 容许的值列表
@return bool:返回true代表在列表中

func HasNotIn

func HasNotIn[T int | string | int32 | int64](value T, allows []T) bool

HasNotIn [T int | string | int32 | int64]

@Description: 判断一个值是否在一个列表中
@param value :需要判断的值
@param allows : 容许的值列表
@return bool :返回值,true代表有不存在于列表中的值

func RemoveString

func RemoveString(slice []string, remove func(item string) bool) []string

RemoveString remove string from slice if function return true.

Types

This section is empty.

Jump to

Keyboard shortcuts

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