(operand ast.Expr, testOnly bool, op string, field string)
| 376 | } |
| 377 | |
| 378 | func (un *unparser) visitSelectInternal(operand ast.Expr, testOnly bool, op string, field string) error { |
| 379 | // handle the case when the select expression was generated by the has() macro. |
| 380 | if testOnly { |
| 381 | un.str.WriteString("has(") |
| 382 | } |
| 383 | nested := !testOnly && isBinaryOrTernaryOperator(operand) |
| 384 | err := un.visitMaybeNested(operand, nested) |
| 385 | if err != nil { |
| 386 | return err |
| 387 | } |
| 388 | un.str.WriteString(op) |
| 389 | un.str.WriteString(maybeQuoteField(field)) |
| 390 | if testOnly { |
| 391 | un.str.WriteString(")") |
| 392 | } |
| 393 | return nil |
| 394 | } |
| 395 | |
| 396 | func (un *unparser) visitStructMsg(expr ast.Expr) error { |
| 397 | m := expr.AsStruct() |
no test coverage detected