Expose parser API as unstable (#827)

This commit is contained in:
Thomas Pelletier
2022-11-09 16:12:39 -05:00
committed by GitHub
parent c83d001c6d
commit e195b58fd0
21 changed files with 628 additions and 523 deletions
+3 -1
View File
@@ -12,6 +12,8 @@ import (
"strings"
"time"
"unicode"
"github.com/pelletier/go-toml/v2/internal/characters"
)
// Marshal serializes a Go value as a TOML document.
@@ -437,7 +439,7 @@ func (enc *Encoder) encodeString(b []byte, v string, options valueOptions) []byt
func needsQuoting(v string) bool {
// TODO: vectorize
for _, b := range []byte(v) {
if b == '\'' || b == '\r' || b == '\n' || invalidAscii(b) {
if b == '\'' || b == '\r' || b == '\n' || characters.InvalidAscii(b) {
return true
}
}