mirror of
https://github.com/go-ini/ini.git
synced 2026-06-19 21:46:45 +02:00
remove noisy new line when default section is empty
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user