Этот коммит содержится в:
Christopher Speller
2017-09-29 12:46:30 -07:00
коммит произвёл GitHub
родитель 8b9dbb8613
Коммит b84736e9b6
422 изменённых файлов: 39231 добавлений и 28592 удалений

1
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

5
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

3
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
}

13
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)