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