slice

package
v1.0.91 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 License: MIT Imports: 2 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsFloat

func ContainsFloat(haystack []float64, needle float64) bool

ContainsFloat returns true if float needle is an element in float slice haystack

func ContainsInt

func ContainsInt(haystack []int, needle int) bool

ContainsInt returns true if int needle is an element in int slice haystack

func ContainsString

func ContainsString(haystack []string, needle string) bool

ContainsString returns true if string needle is an element in string slice haystack

func MedianFloats

func MedianFloats(in []float64) float64

MedianFloats gets the median number in the given slice of float64.

func MedianInts

func MedianInts(in []int) int

MedianInts gets the median number in the given slice of ints.

func StringToInt

func StringToInt(in []string) []int

StringToInt takes a slice of string and returns a slice of int.

func SumFloats

func SumFloats(in []float64) float64

SumFloats returns the sum of all elements in the given slice of float64.

func SumInts

func SumInts(in []int) int

SumInts returns the sum of all elements in the given slice of ints.

func UniqueInt

func UniqueInt(in []int) []int

UniqueInt takes a slice of int and returns a slice with only unique elements.

func UniqueString

func UniqueString(in []string, allowEmpty bool) []string

UniqueString takes a slice of string and returns a slice with only unique elements.

Types

This section is empty.

Jump to

Keyboard shortcuts

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