diff options
Diffstat (limited to 'vendor/github.com/magiconair')
4 files changed, 22 insertions, 0 deletions
diff --git a/vendor/github.com/magiconair/properties/.travis.yml b/vendor/github.com/magiconair/properties/.travis.yml index 60436b202..ab9803902 100644 --- a/vendor/github.com/magiconair/properties/.travis.yml +++ b/vendor/github.com/magiconair/properties/.travis.yml @@ -5,4 +5,5 @@ go: - 1.6.x - 1.7.x - 1.8.x + - 1.9.x - tip diff --git a/vendor/github.com/magiconair/properties/CHANGELOG.md b/vendor/github.com/magiconair/properties/CHANGELOG.md index 4905fec99..ebd1bcd32 100644 --- a/vendor/github.com/magiconair/properties/CHANGELOG.md +++ b/vendor/github.com/magiconair/properties/CHANGELOG.md @@ -1,5 +1,10 @@ ## Changelog +### Unreleased + + * [PR #24](https://github.com/magiconair/properties/pull/24): Update keys when DisableExpansion is enabled + Thanks to @mgurov for the fix. + ### [1.7.3](https://github.com/magiconair/properties/tags/v1.7.3) - 10 Jul 2017 * [Issue #17](https://github.com/magiconair/properties/issues/17): Add [SetValue()](http://godoc.org/github.com/magiconair/properties#Properties.SetValue) method to set values generically diff --git a/vendor/github.com/magiconair/properties/properties.go b/vendor/github.com/magiconair/properties/properties.go index 4f3d5a458..85bb18618 100644 --- a/vendor/github.com/magiconair/properties/properties.go +++ b/vendor/github.com/magiconair/properties/properties.go @@ -511,6 +511,9 @@ func (p *Properties) Set(key, value string) (prev string, ok bool, err error) { if p.DisableExpansion { prev, ok = p.Get(key) p.m[key] = value + if !ok { + p.k = append(p.k, key) + } return prev, ok, nil } diff --git a/vendor/github.com/magiconair/properties/properties_test.go b/vendor/github.com/magiconair/properties/properties_test.go index 0eac1f492..7e92618e0 100644 --- a/vendor/github.com/magiconair/properties/properties_test.go +++ b/vendor/github.com/magiconair/properties/properties_test.go @@ -458,6 +458,19 @@ func TestDisableExpansion(t *testing.T) { assert.Equal(t, p.MustGet("keyB"), "${keyA}") } +func TestDisableExpansionStillUpdatesKeys(t *testing.T) { + p := NewProperties() + p.MustSet("p1", "a") + assert.Equal(t, p.Keys(), []string{"p1"}) + assert.Equal(t, p.String(), "p1 = a\n") + + p.DisableExpansion = true + p.MustSet("p2", "b") + + assert.Equal(t, p.Keys(), []string{"p1", "p2"}) + assert.Equal(t, p.String(), "p1 = a\np2 = b\n") +} + func TestMustGet(t *testing.T) { input := "key = value\nkey2 = ghi" p := mustParse(t, input) |