MCPcopy Create free account
hub / github.com/cel-expr/cel-go / formatPath

Function formatPath

cel/fieldpaths.go:50–65  ·  view source on GitHub ↗
(path []string)

Source from the content-addressed store, hash-verified

48}
49
50func formatPath(path []string) string {
51 var buffer strings.Builder
52 for i, p := range path {
53 if i == 0 {
54 buffer.WriteString(p)
55 continue
56 }
57 if strings.HasPrefix(p, "[") {
58 buffer.WriteString(p)
59 continue
60 }
61 buffer.WriteString(".")
62 buffer.WriteString(p)
63 }
64 return buffer.String()
65}
66
67func (b *backtrack) expandFieldPaths(celType *Type, paths []*fieldPath) []*fieldPath {
68 if slices.ContainsFunc(b.types[:len(b.types)-1], func(t *Type) bool { return t.String() == celType.String() }) {

Callers 1

expandFieldPathsMethod · 0.85

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected