goslicededup

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2022 License: MIT Imports: 0 Imported by: 0

README

Go Slice Deduplicate using Generics

Remove duplicates for a slice with the use of generics

Docs

Go Reference

DeDuplicate[T string | int | int32 | int64 | float32 | float64 | uint](list []T) []T

Example

list := []int{1, 2, 1, 3}
listUnique := DeDuplicate(list)
assert.Equal(t, []int{1, 2, 3}, listUnique, "should find 1,2,3 from deduplicated list of 1,2,1,3")

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeDuplicate

func DeDuplicate[T string | int | int32 | int64 | float32 | float64 | uint](list []T) []T

Types

This section is empty.

Jump to

Keyboard shortcuts

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