diff options
author | dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> | 2022-01-18 20:34:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-18 20:34:42 +0100 |
commit | 6aa05b39810bef5b5cf21cb2abd02012ce727574 (patch) | |
tree | ef76720d307a7edd2b71f1ae005df8b62594d7cd /vendor/gopkg.in/ini.v1 | |
parent | aad60c882e16cd2c8769a49e6d9f87a040590d62 (diff) | |
download | matterbridge-msglm-6aa05b39810bef5b5cf21cb2abd02012ce727574.tar.gz matterbridge-msglm-6aa05b39810bef5b5cf21cb2abd02012ce727574.tar.bz2 matterbridge-msglm-6aa05b39810bef5b5cf21cb2abd02012ce727574.zip |
Bump github.com/spf13/viper from 1.9.0 to 1.10.1 (#1684)
Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.9.0 to 1.10.1.
- [Release notes](https://github.com/spf13/viper/releases)
- [Commits](https://github.com/spf13/viper/compare/v1.9.0...v1.10.1)
---
updated-dependencies:
- dependency-name: github.com/spf13/viper
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Diffstat (limited to 'vendor/gopkg.in/ini.v1')
-rw-r--r-- | vendor/gopkg.in/ini.v1/file.go | 6 | ||||
-rw-r--r-- | vendor/gopkg.in/ini.v1/parser.go | 26 |
2 files changed, 10 insertions, 22 deletions
diff --git a/vendor/gopkg.in/ini.v1/file.go b/vendor/gopkg.in/ini.v1/file.go index 13459181..7b4e560d 100644 --- a/vendor/gopkg.in/ini.v1/file.go +++ b/vendor/gopkg.in/ini.v1/file.go @@ -142,6 +142,12 @@ func (f *File) GetSection(name string) (*Section, error) { return secs[0], err } +// HasSection returns true if the file contains a section with given name. +func (f *File) HasSection(name string) bool { + section, _ := f.GetSection(name) + return section != nil +} + // SectionsByName returns all sections with given name. func (f *File) SectionsByName(name string) ([]*Section, error) { if len(name) == 0 { diff --git a/vendor/gopkg.in/ini.v1/parser.go b/vendor/gopkg.in/ini.v1/parser.go index b8b5aa86..ac1c980a 100644 --- a/vendor/gopkg.in/ini.v1/parser.go +++ b/vendor/gopkg.in/ini.v1/parser.go @@ -302,15 +302,9 @@ func (p *parser) readPythonMultilines(line string, bufferSize int) (string, erro parserBufferPeekResult, _ := p.buf.Peek(bufferSize) peekBuffer := bytes.NewBuffer(parserBufferPeekResult) - indentSize := 0 for { peekData, peekErr := peekBuffer.ReadBytes('\n') - if peekErr != nil { - if peekErr == io.EOF { - p.debug("readPythonMultilines: io.EOF, peekData: %q, line: %q", string(peekData), line) - return line, nil - } - + if peekErr != nil && peekErr != io.EOF { p.debug("readPythonMultilines: failed to peek with error: %v", peekErr) return "", peekErr } @@ -329,19 +323,6 @@ func (p *parser) readPythonMultilines(line string, bufferSize int) (string, erro return line, nil } - // Determine indent size and line prefix. - currentIndentSize := len(peekMatches[1]) - if indentSize < 1 { - indentSize = currentIndentSize - p.debug("readPythonMultilines: indent size is %d", indentSize) - } - - // Make sure each line is indented at least as far as first line. - if currentIndentSize < indentSize { - p.debug("readPythonMultilines: end of value, current indent: %d, expected indent: %d, line: %q", currentIndentSize, indentSize, line) - return line, nil - } - // Advance the parser reader (buffer) in-sync with the peek buffer. _, err := p.buf.Discard(len(peekData)) if err != nil { @@ -349,8 +330,7 @@ func (p *parser) readPythonMultilines(line string, bufferSize int) (string, erro return "", err } - // Handle indented empty line. - line += "\n" + peekMatches[1][indentSize:] + peekMatches[2] + line += "\n" + peekMatches[0] } } @@ -461,6 +441,8 @@ func (f *File) parse(reader io.Reader) (err error) { // Reset auto-counter and comments p.comment.Reset() p.count = 1 + // Nested values can't span sections + isLastValueEmpty = false inUnparseableSection = false for i := range f.options.UnparseableSections { |