Format formats an expression as a string. It does not attempt to remove unnecessary parens.
(e Expr)
| 11 | // Format formats an expression as a string. |
| 12 | // It does not attempt to remove unnecessary parens. |
| 13 | func Format(e Expr) string { |
| 14 | var buf bytes.Buffer |
| 15 | write(&buf, e) |
| 16 | return buf.String() |
| 17 | } |
| 18 | |
| 19 | func write(buf *bytes.Buffer, e Expr) { |
| 20 | switch e := e.(type) { |