MCPcopy Create free account
hub / github.com/cockscomb/cel2sql / extractFieldName

Function extractFieldName

cel2sql.go:836–845  ·  view source on GitHub ↗
(node *exprpb.Expr)

Source from the content-addressed store, hash-verified

834}
835
836func extractFieldName(node *exprpb.Expr) (string, error) {
837 if !isStringLiteral(node) {
838 return "", fmt.Errorf("unsupported type: %v", node)
839 }
840 fieldName := node.GetConstExpr().GetStringValue()
841 if err := validateFieldName(fieldName); err != nil {
842 return "", err
843 }
844 return fieldName, nil
845}

Callers 2

visitCallMapIndexMethod · 0.85
visitStructMapMethod · 0.85

Calls 2

isStringLiteralFunction · 0.85
validateFieldNameFunction · 0.85

Tested by

no test coverage detected