slice

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package slice contains utility functions to manage slices.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LongestString added in v0.8.2

func LongestString(slice []string) string

LongestString returns the longest string in a slice of strings.

func Merge added in v0.10.2

func Merge[K comparable](s1, s2 []K) []K

Merge merges two slices removing duplicates.

func Remove added in v0.10.2

func Remove[K comparable](slice []K, s K) []K

Remove returns a newly created slice that contains all items from slice that are not equal to s.

func Sub added in v0.10.2

func Sub[K comparable](s1, s2 []K) []K

Sub removes elements of s2 from s1.

Types

This section is empty.

Jump to

Keyboard shortcuts

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