diff options
Diffstat (limited to 'vendor/gopkg.in/ini.v1/file.go')
-rw-r--r-- | vendor/gopkg.in/ini.v1/file.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/vendor/gopkg.in/ini.v1/file.go b/vendor/gopkg.in/ini.v1/file.go index b96d172c..13459181 100644 --- a/vendor/gopkg.in/ini.v1/file.go +++ b/vendor/gopkg.in/ini.v1/file.go @@ -168,8 +168,9 @@ func (f *File) SectionsByName(name string) ([]*Section, error) { func (f *File) Section(name string) *Section { sec, err := f.GetSection(name) if err != nil { - // Note: It's OK here because the only possible error is empty section name, - // but if it's empty, this piece of code won't be executed. + if name == "" { + name = DefaultSection + } sec, _ = f.NewSection(name) return sec } |