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

Function maybeSuffixError

ext/math.go:964–972  ·  view source on GitHub ↗
(val ref.Val, suffix string)

Source from the content-addressed store, hash-verified

962}
963
964func maybeSuffixError(val ref.Val, suffix string) ref.Val {
965 if types.IsError(val) {
966 msg := val.(*types.Err).String()
967 if !strings.Contains(msg, suffix) {
968 return types.NewErr("%s: %s", msg, suffix)
969 }
970 }
971 return val
972}
973
974func estimateMathListCost(estimator checker.CostEstimator, target *checker.AstNode, args []checker.AstNode) *checker.CallEstimate {
975 if len(args) != 1 {

Callers 3

signFunction · 0.85
minPairFunction · 0.85
maxPairFunction · 0.85

Calls 4

IsErrorFunction · 0.92
NewErrFunction · 0.92
StringMethod · 0.65
ContainsMethod · 0.65

Tested by

no test coverage detected