Remove buffering from builder
This commit is contained in:
parent
4bb3f9f999
commit
d68ddf1164
6
ini.go
6
ini.go
|
@ -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,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue