diff options
Diffstat (limited to 'internal/fastio/allwriter.go')
-rw-r--r-- | internal/fastio/allwriter.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/internal/fastio/allwriter.go b/internal/fastio/allwriter.go index 9de8fdc..c587531 100644 --- a/internal/fastio/allwriter.go +++ b/internal/fastio/allwriter.go @@ -7,6 +7,8 @@ package fastio import ( "io" "unicode/utf8" + + "git.lukeshu.com/go/lowmemjson/internal/fastio/noescape" ) // interfaces ///////////////////////////////////////////////////////////////// @@ -28,18 +30,18 @@ type AllWriter interface { func WriteByte(w io.Writer, b byte) error { var buf [1]byte buf[0] = b - _, err := w.Write(buf[:]) + _, err := noescape.Write(w, buf[:]) return err } func WriteRune(w io.Writer, r rune) (int, error) { var buf [utf8.UTFMax]byte n := utf8.EncodeRune(buf[:], r) - return w.Write(buf[:n]) + return noescape.Write(w, buf[:n]) } func WriteString(w io.Writer, s string) (int, error) { - return w.Write([]byte(s)) + return noescape.Write(w, []byte(s)) } // wrappers /////////////////////////////////////////////////////////////////// |