From d68ddf116418f545b2eb2de7c96afa7c5039ce28 Mon Sep 17 00:00:00 2001 From: kayomn Date: Fri, 23 Dec 2022 14:53:44 +0000 Subject: [PATCH] Remove buffering from builder --- ini.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ini.go b/ini.go index a66398c..5c0c02a 100644 --- a/ini.go +++ b/ini.go @@ -9,7 +9,7 @@ import ( // State machine for writing to streamable INI file sources. type Builder struct { - writer *bufio.Writer + writer io.Writer } // Singular key-value pair under the given section within an INI file. @@ -38,9 +38,11 @@ func (builder *Builder) KeyValue(key string, value string) error { } // Creates and returns a new [Builder] by reference from `writer`. +// +// Note that [NewBuilder] does not buffer write operations. func NewBuilder(writer io.Writer) *Builder { return &Builder{ - writer: bufio.NewWriter(writer), + writer: writer, } }