MCPcopy Create free account
hub / github.com/Permify/permify / IsSameArray

Function IsSameArray

integration-test/usecases/test_utils.go:8–28  ·  view source on GitHub ↗

IsSameArray - check if two arrays are the same

(a, b []string)

Source from the content-addressed store, hash-verified

6
7// IsSameArray - check if two arrays are the same
8func IsSameArray(a, b []string) bool {
9 if len(a) != len(b) {
10 return false
11 }
12
13 sortedA := make([]string, len(a))
14 copy(sortedA, a)
15 sort.Strings(sortedA)
16
17 sortedB := make([]string, len(b))
18 copy(sortedB, b)
19 sort.Strings(sortedB)
20
21 for i := range sortedA {
22 if sortedA[i] != sortedB[i] {
23 return false
24 }
25 }
26
27 return true
28}

Callers 3

notion_test.goFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected