File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -199,6 +199,9 @@ type Viper struct {
199
199
configPermissions os.FileMode
200
200
envPrefix string
201
201
202
+ // Specific commands for ini parsing
203
+ iniLoadOptions ini.LoadOptions
204
+
202
205
automaticEnvApplied bool
203
206
envKeyReplacer StringReplacer
204
207
allowEmptyEnv bool
@@ -1637,7 +1640,7 @@ func (v *Viper) unmarshalReader(in io.Reader, c map[string]interface{}) error {
1637
1640
}
1638
1641
1639
1642
case "ini" :
1640
- cfg := ini .Empty ()
1643
+ cfg := ini .Empty (v . iniLoadOptions )
1641
1644
err := cfg .Append (buf .Bytes ())
1642
1645
if err != nil {
1643
1646
return ConfigParseError {err }
@@ -2081,6 +2084,13 @@ func (v *Viper) SetConfigPermissions(perm os.FileMode) {
2081
2084
v .configPermissions = perm .Perm ()
2082
2085
}
2083
2086
2087
+ // IniLoadOptions sets the load options for ini parsing.
2088
+ func IniLoadOptions (in ini.LoadOptions ) Option {
2089
+ return optionFunc (func (v * Viper ) {
2090
+ v .iniLoadOptions = in
2091
+ })
2092
+ }
2093
+
2084
2094
func (v * Viper ) getConfigType () string {
2085
2095
if v .configType != "" {
2086
2096
return v .configType
You can’t perform that action at this time.
0 commit comments