hasProtoExt generates a test-only select expression for a fully-qualified extension name on a protobuf message.
(mef cel.MacroExprFactory, target ast.Expr, args []ast.Expr)
| 104 | |
| 105 | // hasProtoExt generates a test-only select expression for a fully-qualified extension name on a protobuf message. |
| 106 | func hasProtoExt(mef cel.MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *cel.Error) { |
| 107 | if !macroTargetMatchesNamespace(protoNamespace, target) { |
| 108 | return nil, nil |
| 109 | } |
| 110 | extensionField, err := getExtFieldName(mef, args[1]) |
| 111 | if err != nil { |
| 112 | return nil, err |
| 113 | } |
| 114 | return mef.NewPresenceTest(args[0], extensionField), nil |
| 115 | } |
| 116 | |
| 117 | // getProtoExt generates a select expression for a fully-qualified extension name on a protobuf message. |
| 118 | func getProtoExt(mef cel.MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *cel.Error) { |
nothing calls this directly
no test coverage detected