vendor: update all dependencies
This commit is contained in:
+31
-4
@@ -87,7 +87,7 @@ key1, err := sec1.GetKey("Key")
|
||||
key2, err := sec2.GetKey("KeY")
|
||||
```
|
||||
|
||||
#### MySQL-like boolean key
|
||||
#### MySQL-like boolean key
|
||||
|
||||
MySQL's configuration allows a key without value as follows:
|
||||
|
||||
@@ -320,7 +320,7 @@ cfg, err := ini.LoadSources(ini.LoadOptions{
|
||||
}, "filename")
|
||||
```
|
||||
|
||||
Holy crap!
|
||||
Holy crap!
|
||||
|
||||
Note that single quotes around values will be stripped:
|
||||
|
||||
@@ -339,7 +339,7 @@ How do you transform this to regular format automatically?
|
||||
|
||||
```go
|
||||
cfg, err := ini.LoadSources(ini.LoadOptions{UnescapeValueDoubleQuotes: true}, "en-US.ini"))
|
||||
cfg.Section("<name of your section>").Key("create_repo").String()
|
||||
cfg.Section("<name of your section>").Key("create_repo").String()
|
||||
// You got: created repository <a href="%s">%s</a>
|
||||
```
|
||||
|
||||
@@ -440,7 +440,7 @@ By default, spaces are used to align "=" sign between key and values, to disable
|
||||
|
||||
```go
|
||||
ini.PrettyFormat = false
|
||||
```
|
||||
```
|
||||
|
||||
## Advanced Usage
|
||||
|
||||
@@ -489,6 +489,33 @@ cfg.Section("package.sub").Key("CLONE_URL").String() // https://gopkg.in/ini.v1
|
||||
cfg.Section("package.sub").ParentKeys() // ["CLONE_URL"]
|
||||
```
|
||||
|
||||
### Same Key with Multiple Values
|
||||
|
||||
Do you ever have a configuration file like this?
|
||||
|
||||
```ini
|
||||
[remote "origin"]
|
||||
url = https://github.com/Antergone/test1.git
|
||||
url = https://github.com/Antergone/test2.git
|
||||
fetch = +refs/heads/*:refs/remotes/origin/*
|
||||
```
|
||||
|
||||
By default, only the last read value will be kept for the key `url`. If you want to keep all copies of value of this key, you can use `ShadowLoad` to achieve it:
|
||||
|
||||
```go
|
||||
cfg, err := ini.ShadowLoad(".gitconfig")
|
||||
// ...
|
||||
|
||||
f.Section(`remote "origin"`).Key("url").String()
|
||||
// Result: https://github.com/Antergone/test1.git
|
||||
|
||||
f.Section(`remote "origin"`).Key("url").ValueWithShadows()
|
||||
// Result: []string{
|
||||
// "https://github.com/Antergone/test1.git",
|
||||
// "https://github.com/Antergone/test2.git",
|
||||
// }
|
||||
```
|
||||
|
||||
### Unparseable Sections
|
||||
|
||||
Sometimes, you have sections that do not contain key-value pairs but raw content, to handle such case, you can use `LoadOptions.UnparsableSections`:
|
||||
|
||||
Reference in New Issue
Block a user