mirror of
https://github.com/rclone/rclone.git
synced 2025-12-20 02:03:17 +00:00
vendor: Update github.com/Unknwon/goconfig to fix section listing
This fixes listing sections just after creation which means the rclone config list will have all the keys in now.
This commit is contained in:
13
vendor/github.com/Unknwon/goconfig/conf.go
generated
vendored
13
vendor/github.com/Unknwon/goconfig/conf.go
generated
vendored
@@ -374,13 +374,12 @@ func (c *ConfigFile) GetKeyList(section string) []string {
|
||||
}
|
||||
|
||||
// Non-default section has a blank key as section keeper.
|
||||
offset := 1
|
||||
if section == DEFAULT_SECTION {
|
||||
offset = 0
|
||||
list := make([]string, 0, len(c.keyList[section]))
|
||||
for _, key := range c.keyList[section] {
|
||||
if key != " " {
|
||||
list = append(list, key)
|
||||
}
|
||||
}
|
||||
|
||||
list := make([]string, len(c.keyList[section])-offset)
|
||||
copy(list, c.keyList[section][offset:])
|
||||
return list
|
||||
}
|
||||
|
||||
@@ -420,7 +419,7 @@ func (c *ConfigFile) DeleteSection(section string) bool {
|
||||
}
|
||||
|
||||
// GetSection returns key-value pairs in given section.
|
||||
// It section does not exist, returns nil and error.
|
||||
// If section does not exist, returns nil and error.
|
||||
func (c *ConfigFile) GetSection(section string) (map[string]string, error) {
|
||||
// Blank section name represents DEFAULT section.
|
||||
if len(section) == 0 {
|
||||
|
||||
Reference in New Issue
Block a user