getProtoExt generates a select expression for a fully-qualified extension name on a protobuf message.
(mef cel.MacroExprFactory, target ast.Expr, args []ast.Expr)
| 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) { |
| 119 | if !macroTargetMatchesNamespace(protoNamespace, target) { |
| 120 | return nil, nil |
| 121 | } |
| 122 | extFieldName, err := getExtFieldName(mef, args[1]) |
| 123 | if err != nil { |
| 124 | return nil, err |
| 125 | } |
| 126 | return mef.NewSelect(args[0], extFieldName), nil |
| 127 | } |
| 128 | |
| 129 | func getExtFieldName(mef cel.MacroExprFactory, expr ast.Expr) (string, *cel.Error) { |
| 130 | isValid := false |
nothing calls this directly
no test coverage detected