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

Function isSameArray

pkg/development/coverage/coverage_test.go:512–532  ·  view source on GitHub ↗

isSameArray - check if two arrays are the same

(a, b []string)

Source from the content-addressed store, hash-verified

510
511// isSameArray - check if two arrays are the same
512func isSameArray(a, b []string) bool {
513 if len(a) != len(b) {
514 return false
515 }
516
517 sortedA := make([]string, len(a))
518 copy(sortedA, a)
519 sort.Strings(sortedA)
520
521 sortedB := make([]string, len(b))
522 copy(sortedB, b)
523 sort.Strings(sortedB)
524
525 for i := range sortedA {
526 if sortedA[i] != sortedB[i] {
527 return false
528 }
529 }
530
531 return true
532}

Callers 1

coverage_test.goFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected