@@ -174,9 +174,16 @@ func (s *iniConfigSection) ChildSections() (sections []ConfigSection) {
174
174
return sections
175
175
}
176
176
177
+ func configProviderLoadOptions () ini.LoadOptions {
178
+ return ini.LoadOptions {
179
+ KeyValueDelimiterOnWrite : " = " ,
180
+ IgnoreContinuation : true ,
181
+ }
182
+ }
183
+
177
184
// NewConfigProviderFromData this function is mainly for testing purpose
178
185
func NewConfigProviderFromData (configContent string ) (ConfigProvider , error ) {
179
- cfg , err := ini .Load ( strings .NewReader (configContent ))
186
+ cfg , err := ini .LoadSources ( configProviderLoadOptions (), strings .NewReader (configContent ))
180
187
if err != nil {
181
188
return nil , err
182
189
}
@@ -190,7 +197,7 @@ func NewConfigProviderFromData(configContent string) (ConfigProvider, error) {
190
197
// NewConfigProviderFromFile load configuration from file.
191
198
// NOTE: do not print any log except error.
192
199
func NewConfigProviderFromFile (file string , extraConfigs ... string ) (ConfigProvider , error ) {
193
- cfg := ini .Empty (ini. LoadOptions { KeyValueDelimiterOnWrite : " = " } )
200
+ cfg := ini .Empty (configProviderLoadOptions () )
194
201
loadedFromEmpty := true
195
202
196
203
if file != "" {
@@ -339,6 +346,7 @@ func NewConfigProviderForLocale(source any, others ...any) (ConfigProvider, erro
339
346
iniFile , err := ini .LoadSources (ini.LoadOptions {
340
347
IgnoreInlineComment : true ,
341
348
UnescapeValueCommentSymbols : true ,
349
+ IgnoreContinuation : true ,
342
350
}, source , others ... )
343
351
if err != nil {
344
352
return nil , fmt .Errorf ("unable to load locale ini: %w" , err )
0 commit comments