Skip to content

Commit ba73080

Browse files
committed
equality for ns objects
1 parent 47f74fd commit ba73080

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

ns/ns.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@ import (
88
// NS represents a namespace.
99
type NS []string
1010

11+
func Equal(a, b NS) bool {
12+
if len(a) != len(b) {
13+
return false
14+
}
15+
for i := range a {
16+
if a[i] != b[i] {
17+
return false
18+
}
19+
}
20+
return true
21+
}
22+
1123
func ParseFromPath(p string) NS {
1224
return strings.Split(filepath.Clean(p), string(filepath.Separator))
1325
}

0 commit comments

Comments
 (0)