Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/adam-hanna/arrayOperations
/ functions
Functions
21 in github.com/adam-hanna/arrayOperations
⨍
Functions
21
◇
Types & classes
12
↓ 4 callers
Function
Distinct
Distinct returns the unique vals of a slice fmt.Println(Distinct[int]([]int{1, 1, 2, 3})) // output: [1, 2, 3]
arrayOperations.go:90
↓ 4 callers
Function
isEqual
(a, b []T)
arrayOperations_unit_test.go:9
↓ 2 callers
Function
FindOne
FindOne iterates through an array applying the guard function to each element and returns the first element that passes. If no such element is found,
arrayOperations.go:12
↓ 2 callers
Function
guard
(i int)
arrayOperations_unit_test.go:117
↓ 1 callers
Function
Difference
Difference returns a slice of values that are only present in one of the input slices example #1 a := []int{1, 2, 2, 4, 6} b := []int{2, 4, 5} fmt.Pr
arrayOperations.go:200
↓ 1 callers
Function
Filter
Filter iterates through an array applying the guard function to each element and returns the elements that pass arr := []int{0,1,2,3,4} func isEven
arrayOperations.go:56
↓ 1 callers
Function
Intersect
Intersect returns a slice of values that are present in all of the input slices example #1 a := []int{1, 1, 3, 4, 5, 6} b := []int{2, 3, 6} fmt.Print
arrayOperations.go:122
↓ 1 callers
Function
Map
Map iterates through an array applying the transform function to each element and returns the modified array arr := []int{1,2,3} func addTen(i int)
arrayOperations.go:76
↓ 1 callers
Function
Reduce
Reduce iterates through an array applying the function to each element and the cumulative value and the final state of the cumulative value arr := [
arrayOperations.go:38
↓ 1 callers
Function
Union
Union returns a slice that contains the unique values of all the input slices example #1 a := []int{1, 2, 2, 4, 6} b := []int{2, 4, 5} fmt.Println(Un
arrayOperations.go:167
Function
TestDifference
(t *testing.T)
arrayOperations_unit_test.go:234
Function
TestDistinct
(t *testing.T)
arrayOperations_unit_test.go:152
Function
TestFilter
(t *testing.T)
arrayOperations_unit_test.go:121
Function
TestFindOne
(t *testing.T)
arrayOperations_unit_test.go:64
Function
TestIntersect
(t *testing.T)
arrayOperations_unit_test.go:178
Function
TestMap
(t *testing.T)
arrayOperations_unit_test.go:135
Function
TestReduce
(t *testing.T)
arrayOperations_unit_test.go:102
Function
TestUnion
(t *testing.T)
arrayOperations_unit_test.go:206
Function
addTen
(i int)
arrayOperations_unit_test.go:131
Function
countAnimals
(state map[string]int, animal string)
arrayOperations_unit_test.go:91
Function
findOneGuard
(i int)
arrayOperations_unit_test.go:60