removeNewline removes the trailing newline character from the buffer, if present.
()
| 105 | |
| 106 | // removeNewline removes the trailing newline character from the buffer, if present. |
| 107 | func (b *buffer) removeNewline() { |
| 108 | if len(*b) > 0 && (*b)[len(*b)-1] == '\n' { |
| 109 | *b = (*b)[:len(*b)-1] |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | // isStringQuoteSafe checks if a string is safe to append without quoting. |
| 114 | func (b *buffer) isStringQuoteSafe(val string) bool { |