mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 14:50:56 +00:00
Update config.go
This commit is contained in:
parent
428164f395
commit
b9ec30ebdb
@ -46,7 +46,7 @@ type OptionsConfiguration struct {
|
||||
MaxChangeKbps int `xml:"maxChangeKbps" default:"1000" ini:"max-change-bw"`
|
||||
}
|
||||
|
||||
func setDefaults(data interface{}, setNilSlices bool) error {
|
||||
func setDefaults(data interface{}, setEmptySlices bool) error {
|
||||
s := reflect.ValueOf(data).Elem()
|
||||
t := s.Type()
|
||||
|
||||
@ -66,7 +66,7 @@ func setDefaults(data interface{}, setNilSlices bool) error {
|
||||
f.SetString(v)
|
||||
|
||||
case []string:
|
||||
if setNilSlices {
|
||||
if setEmptySlices {
|
||||
rv := reflect.MakeSlice(reflect.TypeOf([]string{}), 1, 1)
|
||||
rv.Index(0).SetString(v)
|
||||
f.Set(rv)
|
||||
|
Loading…
Reference in New Issue
Block a user