@@ -174,9 +174,16 @@ func (s *iniConfigSection) ChildSections() (sections []ConfigSection) {
174174 return sections
175175}
176176
177+ func configProviderLoadOptions () ini.LoadOptions {
178+ return ini.LoadOptions {
179+ KeyValueDelimiterOnWrite : " = " ,
180+ IgnoreContinuation : true ,
181+ }
182+ }
183+
177184// NewConfigProviderFromData this function is mainly for testing purpose
178185func NewConfigProviderFromData (configContent string ) (ConfigProvider , error ) {
179- cfg , err := ini .Load ( strings .NewReader (configContent ))
186+ cfg , err := ini .LoadSources ( configProviderLoadOptions (), strings .NewReader (configContent ))
180187 if err != nil {
181188 return nil , err
182189 }
@@ -190,7 +197,7 @@ func NewConfigProviderFromData(configContent string) (ConfigProvider, error) {
190197// NewConfigProviderFromFile load configuration from file.
191198// NOTE: do not print any log except error.
192199func NewConfigProviderFromFile (file string , extraConfigs ... string ) (ConfigProvider , error ) {
193- cfg := ini .Empty (ini. LoadOptions { KeyValueDelimiterOnWrite : " = " } )
200+ cfg := ini .Empty (configProviderLoadOptions () )
194201 loadedFromEmpty := true
195202
196203 if file != "" {
@@ -339,6 +346,7 @@ func NewConfigProviderForLocale(source any, others ...any) (ConfigProvider, erro
339346 iniFile , err := ini .LoadSources (ini.LoadOptions {
340347 IgnoreInlineComment : true ,
341348 UnescapeValueCommentSymbols : true ,
349+ IgnoreContinuation : true ,
342350 }, source , others ... )
343351 if err != nil {
344352 return nil , fmt .Errorf ("unable to load locale ini: %w" , err )
0 commit comments