sliceutil

package
v0.0.0-...-2ba808a Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert[T1, T2 uint32 | uint64 | int32 | int64](input []T1) []T2

func ConvertStringToInt

func ConvertStringToInt[T uint32 | uint64 | int32 | int64](input []string) ([]T, error)

func ConvertToString

func ConvertToString[S ~[]T, T uint32 | uint64 | int32 | int64](input S) []string

func Difference

func Difference[T comparable](s1, s2 []T) ([]T, []T)

Difference

To return two slices containing difference between s1 & s2 diffS12 = s1 - s2 diffS21 = s2 - s1

func Intersect

func Intersect[T comparable](s1, s2 []T) []T

Intersect

To return the intersection between s1 & s2

func RemoveDuplicatedItems

func RemoveDuplicatedItems[T comparable](input []T) []T

func Unique

func Unique[T comparable](slice []T) []T

Unique

To return a duplicate-free version of a slice

Types

This section is empty.

Jump to

Keyboard shortcuts

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