isStringQuoteSafe checks if a string is safe to append without quoting.
(val string)
| 112 | |
| 113 | // isStringQuoteSafe checks if a string is safe to append without quoting. |
| 114 | func (b *buffer) isStringQuoteSafe(val string) bool { |
| 115 | for i := range len(val) { |
| 116 | if b := val[i]; b >= utf8.RuneSelf || !quoteSafeSet[b] { |
| 117 | return false |
| 118 | } |
| 119 | } |
| 120 | return true |
| 121 | } |
| 122 | |
| 123 | // quoteSafeSet is a set of runes that are safe to append without quoting. |
| 124 | // Some runes here are explicitly marked as unsafe for clarity. |