MCPcopy Create free account
hub / github.com/antchfx/xpath / MustCompile

Function MustCompile

xpath.go:155–161  ·  view source on GitHub ↗

MustCompile compiles an XPath expression string and ignored error.

(expr string)

Source from the content-addressed store, hash-verified

153
154// MustCompile compiles an XPath expression string and ignored error.
155func MustCompile(expr string) *Expr {
156 exp, err := Compile(expr)
157 if err != nil {
158 return &Expr{s: expr, q: nopQuery{}}
159 }
160 return exp
161}
162
163// CompileWithNS compiles an XPath expression string, using given namespaces map.
164func CompileWithNS(expr string, namespaces map[string]string) (*Expr, error) {

Callers 3

ExampleFunction · 0.92
TestMustCompileFunction · 0.85
Test_func_numberFunction · 0.85

Calls 1

CompileFunction · 0.85

Tested by 3

ExampleFunction · 0.74
TestMustCompileFunction · 0.68
Test_func_numberFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…