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

Function SplitRelation

pkg/tuple/tuple.go:128–135  ·  view source on GitHub ↗

SplitRelation splits a relation string by the separator "." and returns the result as a slice

(relation string)

Source from the content-addressed store, hash-verified

126
127// SplitRelation splits a relation string by the separator "." and returns the result as a slice
128func SplitRelation(relation string) (a []string) {
129 s := strings.Split(relation, SEPARATOR) // split relation by the separator "."
130 a = append(a, s...)
131 if len(a) == 1 {
132 a = append(a, "") // if there is only one element in the slice, add an empty string to the end
133 }
134 return a
135}
136
137// IsRelationComputed checks if a relation is computed or not
138func IsRelationComputed(relation string) bool {

Callers 1

tuple_test.goFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected