uniq

package
v1.66.4 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: BSD-3-Clause Imports: 0 Imported by: 6

Documentation

Overview

Package uniq provides removal of adjacent duplicate elements in slices. It is similar to the unix command uniq.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ModifySlice

func ModifySlice[E comparable](slice *[]E)

ModifySlice removes adjacent duplicate elements from the given slice. It adjusts the length of the slice appropriately and zeros the tail.

ModifySlice does O(len(*slice)) operations.

func ModifySliceFunc added in v1.30.0

func ModifySliceFunc[E any](slice *[]E, eq func(i, j E) bool)

ModifySliceFunc is the same as ModifySlice except that it allows using a custom comparison function.

eq should report whether the two provided elements are equal.

Types

This section is empty.

Jump to

Keyboard shortcuts

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