From b3f55d6bda594b795beb085dad5158f0451e16a4 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 8 Mar 2018 13:18:27 +0000 Subject: [PATCH] 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. --- Gopkg.lock | 2 +- vendor/github.com/Unknwon/goconfig/conf.go | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index f51ed7cda..3068baefb 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -38,7 +38,7 @@ branch = "master" name = "github.com/Unknwon/goconfig" packages = ["."] - revision = "87a46d97951ee1ea20ed3b24c25646a79e87ba5d" + revision = "ef1e4c783f8f0478bd8bff0edb3dd0bade552599" [[projects]] branch = "master" diff --git a/vendor/github.com/Unknwon/goconfig/conf.go b/vendor/github.com/Unknwon/goconfig/conf.go index 35fe8b0a9..4e7c8adc9 100644 --- a/vendor/github.com/Unknwon/goconfig/conf.go +++ b/vendor/github.com/Unknwon/goconfig/conf.go @@ -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 {