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:
Nick Craig-Wood 2018-03-08 13:18:27 +00:00
parent d9094f1a45
commit b3f55d6bda
2 changed files with 7 additions and 8 deletions

2
Gopkg.lock generated
View file

@ -38,7 +38,7 @@
branch = "master" branch = "master"
name = "github.com/Unknwon/goconfig" name = "github.com/Unknwon/goconfig"
packages = ["."] packages = ["."]
revision = "87a46d97951ee1ea20ed3b24c25646a79e87ba5d" revision = "ef1e4c783f8f0478bd8bff0edb3dd0bade552599"
[[projects]] [[projects]]
branch = "master" branch = "master"

View file

@ -374,13 +374,12 @@ func (c *ConfigFile) GetKeyList(section string) []string {
} }
// Non-default section has a blank key as section keeper. // Non-default section has a blank key as section keeper.
offset := 1 list := make([]string, 0, len(c.keyList[section]))
if section == DEFAULT_SECTION { for _, key := range c.keyList[section] {
offset = 0 if key != " " {
list = append(list, key)
}
} }
list := make([]string, len(c.keyList[section])-offset)
copy(list, c.keyList[section][offset:])
return list return list
} }
@ -420,7 +419,7 @@ func (c *ConfigFile) DeleteSection(section string) bool {
} }
// GetSection returns key-value pairs in given section. // 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) { func (c *ConfigFile) GetSection(section string) (map[string]string, error) {
// Blank section name represents DEFAULT section. // Blank section name represents DEFAULT section.
if len(section) == 0 { if len(section) == 0 {