isCELCaddyPlaceholderCall returns whether the expression is a caddy placeholder call.
(e ast.Expr)
| 751 | |
| 752 | // isCELCaddyPlaceholderCall returns whether the expression is a caddy placeholder call. |
| 753 | func isCELCaddyPlaceholderCall(e ast.Expr) bool { |
| 754 | switch e.Kind() { |
| 755 | case ast.CallKind: |
| 756 | call := e.AsCall() |
| 757 | if call.FunctionName() == CELPlaceholderFuncName { |
| 758 | return true |
| 759 | } |
| 760 | case ast.UnspecifiedExprKind, ast.ComprehensionKind, ast.IdentKind, ast.ListKind, ast.LiteralKind, ast.MapKind, ast.SelectKind, ast.StructKind: |
| 761 | // appeasing the linter :) |
| 762 | } |
| 763 | return false |
| 764 | } |
| 765 | |
| 766 | // isCELConcatCall tests whether the expression is a concat function (+) with string, placeholder, or |
| 767 | // other concat call arguments. |