Remove buffering from builder

This commit is contained in:
kayomn 2022-12-23 14:53:44 +00:00
parent 4bb3f9f999
commit d68ddf1164
1 changed files with 4 additions and 2 deletions

6
ini.go
View File

@ -9,7 +9,7 @@ import (
// State machine for writing to streamable INI file sources. // State machine for writing to streamable INI file sources.
type Builder struct { type Builder struct {
writer *bufio.Writer writer io.Writer
} }
// Singular key-value pair under the given section within an INI file. // 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`. // Creates and returns a new [Builder] by reference from `writer`.
//
// Note that [NewBuilder] does not buffer write operations.
func NewBuilder(writer io.Writer) *Builder { func NewBuilder(writer io.Writer) *Builder {
return &Builder{ return &Builder{
writer: bufio.NewWriter(writer), writer: writer,
} }
} }