M ini.go => ini.go +3 -0
@@ 536,6 536,9 @@ func (d *decoder) readSubsection() (next nextfunc, err error) {
func (d *decoder) start() (next nextfunc, err error) {
_, _, err = d.nextRune()
+ if err == io.EOF {
+ return nil, nil
+ }
return d.readElem, err
}
M ini_test.go => ini_test.go +4 -0
@@ 54,6 54,10 @@ func TestReadINI_section_badspace(t *testing.T) {
}
func TestReadINIEmpty(t *testing.T) {
+ testReadINIMatching(t, nil, "", Values{})
+}
+
+func TestReadININoValues(t *testing.T) {
testReadINIMatching(t, nil, "\n\t\n;empty\n\t\n\t", Values{})
}