Fix writespacing in writing function
This commit is contained in:
parent
a82d80cf7f
commit
8a897dbd24
8
ini.go
8
ini.go
|
@ -102,9 +102,7 @@ func Write(writer io.StringWriter, entries []Entry) error {
|
|||
|
||||
for _, entry := range entries {
|
||||
if entry.Section != section {
|
||||
section = entry.Section
|
||||
|
||||
if _, writeError := writer.WriteString("["); writeError != nil {
|
||||
if _, writeError := writer.WriteString("\n["); writeError != nil {
|
||||
return writeError
|
||||
}
|
||||
|
||||
|
@ -112,9 +110,11 @@ func Write(writer io.StringWriter, entries []Entry) error {
|
|||
return writeError
|
||||
}
|
||||
|
||||
if _, writeError := writer.WriteString("]"); writeError != nil {
|
||||
if _, writeError := writer.WriteString("]\n"); writeError != nil {
|
||||
return writeError
|
||||
}
|
||||
|
||||
section = entry.Section
|
||||
}
|
||||
|
||||
if _, writeError := writer.WriteString(entry.Key); writeError != nil {
|
||||
|
|
Loading…
Reference in New Issue