slicex

package
v2.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compare added in v2.2.1

func Compare[T any](s1 []T, s2 []T) bool

Compare returns true if both slices have identical elements, else returns false.

func Contains

func Contains[T any](e T, s []T) bool

Contains returns true if element e is found in slice s else returns false. The type T can be either int, string or bool only.

func DeleteElementAtIndex

func DeleteElementAtIndex[T any](i int, s []T) []T

DeleteElementAtIndex returns a new slice with element at index deleted.

Types

type Floats added in v2.2.4

type Floats []float64

func (Floats) String added in v2.2.4

func (fs Floats) String() string

String returns a nicely formatted output to use in fmt functions.

func (Floats) Total added in v2.2.4

func (fs Floats) Total() (total float64)

Total returns the total value of the slice of float64.

type Ints added in v2.2.4

type Ints []int

func (Ints) String added in v2.2.4

func (ints Ints) String() string

String returns a nicely formatted output to use in fmt functions.

func (Ints) Total added in v2.2.4

func (ints Ints) Total() (total int)

Total returns the total value of the slice of int.

Jump to

Keyboard shortcuts

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