remove noisy new line when default section is empty

This commit is contained in:
Unknwon
2015-01-02 15:18:07 +08:00
parent b025723539
commit e78794531f
+5
View File
@@ -865,6 +865,11 @@ func (f *File) SaveTo(filename string) (err error) {
if _, err = buf.WriteString("[" + sname + "]" + LineBreak); err != nil {
return err
}
} else {
// Write nothing if default section is empty.
if len(sec.keyList) == 0 {
continue
}
}
for _, kname := range sec.keyList {