Don't mangle the spaces when editing properties files; closes #2041 (again)
This commit is contained in:
parent
e87e8848e6
commit
86727b628e
|
@ -3,6 +3,7 @@ package parser
|
|||
import (
|
||||
"bufio"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/apex/log"
|
||||
"github.com/beevik/etree"
|
||||
"github.com/buger/jsonparser"
|
||||
|
@ -454,7 +455,20 @@ func (f *ConfigurationFile) parsePropertiesFile(path string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
_, err = p.Write(w, properties.UTF8)
|
||||
var s string
|
||||
// This is a copy of the properties.String() func except we don't plop spaces around
|
||||
// the key=value configurations since people like to complain about that.
|
||||
// func (p *Properties) String() string
|
||||
for _, key := range p.Keys() {
|
||||
value, _ := p.Get(key)
|
||||
|
||||
s = fmt.Sprintf("%s%s=%s\n", s, key, value)
|
||||
}
|
||||
|
||||
// Can't use the properties.Write() function since that doesn't apply our nicer formatting.
|
||||
if _, err := w.Write([]byte(s)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user