slice

package
v0.0.0-...-b6f14a9 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbsDiffString

func AbsDiffString(a, b []string) []string

AbsDiffString returns the absolute subtraction of tow string slices

func Contains

func Contains(obj interface{}, target []interface{}) bool

Contains returns wether the given obj is in the targe.

func ContainsInt

func ContainsInt(obj int, target []int) bool

ContainsInt returns wether the given integer is in the target slice.

func ContainsString

func ContainsString(obj string, target []string) bool

ContainsString returns wether the obj is in the target.

func DiffString

func DiffString(a, b []string) []string

DiffString returns the subtraction of tow string slices whtich in a but not in b

func Index

func Index(limit int, predicate func(i int) bool) int

Index returns the obj index in user-defined data type.

func RemoveDuplicatesInt

func RemoveDuplicatesInt(s *[]int)

RemoveDuplicatesInt removes the duplicated element from the slice.

func RemoveDuplicatesString

func RemoveDuplicatesString(s *[]string)

RemoveDuplicatesString removes the duplicated element from the slice.

func RemoveIntUnordered

func RemoveIntUnordered(data, remove []int) []int

RemoveIntUnordered returns the unordered remaining slice after getting rid of arg2 from arg1. This function do not preserve the order of origin slice.

func RemoveStringUnordered

func RemoveStringUnordered(data, remove []string) []string

RemoveStringUnordered returns the unordered remaining slice after getting rid of arg2 from arg1.

func RemoveUnordered

func RemoveUnordered(data, remove interface{}) (interface{}, error)

RemoveUnordered returns the unordered remaining slice after getting rid of arg2 from arg1 using reflection. Please only use it in generic type processing for low performance.

Types

This section is empty.

Jump to

Keyboard shortcuts

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