Documentation ¶
Index ¶
- func Append[TYPE any](slice []TYPE, values ...TYPE) (newSlice []TYPE)
- func Copy[TYPE any](slice []TYPE) (newSlice []TYPE)
- func Cut[TYPE comparable](slice []TYPE, from, length int) (newSlice []TYPE)
- func Dequeue[TYPE any](slice []byte) (newSlice []byte, value TYPE, ok bool)
- func DequeueBytes(slice []byte, length int) (newSlice []byte, cuted []byte, ok bool)
- func DequeueString(slice []byte, length int) (newSlice []byte, str string, ok bool)
- func Enqueue[TYPE any](slice []byte, value TYPE) (newSlice []byte)
- func Index[TYPE comparable](slice []TYPE, value TYPE) int
- func Inserts[TYPE any](slice []TYPE, from int, values ...TYPE) (newSlice []TYPE)
- func Remove[TYPE comparable](slice []TYPE, value TYPE) (newSlice []TYPE)
- func Sort[TYPE comparable](slice []TYPE, swap func(first, last TYPE) bool) (newSlice []TYPE)
- func Unite[TYPE comparable](slice1 []TYPE, slice2 []TYPE) (unite []TYPE)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Append ¶ added in v1.8.0
func Append[TYPE any](slice []TYPE, values ...TYPE) (newSlice []TYPE)
后面追加
func Cut ¶
func Cut[TYPE comparable](slice []TYPE, from, length int) (newSlice []TYPE)
slice中移除from开始到length长度的数据,from和length错误会产生panic
func DequeueBytes ¶ added in v1.8.0
slice前面取出片段
func DequeueString ¶
slice前面取出字符串
func Remove ¶
func Remove[TYPE comparable](slice []TYPE, value TYPE) (newSlice []TYPE)
从slice中删除所有value
func Sort ¶
func Sort[TYPE comparable](slice []TYPE, swap func(first, last TYPE) bool) (newSlice []TYPE)
根据swap快速度排序,若swap回调函数的front应该在back后面返回true.
func Unite ¶ added in v1.8.0
func Unite[TYPE comparable](slice1 []TYPE, slice2 []TYPE) (unite []TYPE)
返回两个slice的交集
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.