mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 04:52:24 -05:00
Upstep Go dependencies (#340)
* Upstep Go dependencies * tiny linter fix * Tidy
This commit is contained in:
parent
5506a5ecbe
commit
67ac8db190
160 changed files with 248601 additions and 232400 deletions
2
vendor/gopkg.in/ini.v1/README.md
generated
vendored
2
vendor/gopkg.in/ini.v1/README.md
generated
vendored
|
|
@ -24,7 +24,7 @@ Package ini provides INI file read and write functionality in Go.
|
|||
|
||||
## Installation
|
||||
|
||||
The minimum requirement of Go is **1.6**.
|
||||
The minimum requirement of Go is **1.12**.
|
||||
|
||||
```sh
|
||||
$ go get gopkg.in/ini.v1
|
||||
|
|
|
|||
11
vendor/gopkg.in/ini.v1/file.go
generated
vendored
11
vendor/gopkg.in/ini.v1/file.go
generated
vendored
|
|
@ -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 {
|
||||
|
|
@ -168,8 +174,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
|
||||
}
|
||||
|
|
|
|||
26
vendor/gopkg.in/ini.v1/parser.go
generated
vendored
26
vendor/gopkg.in/ini.v1/parser.go
generated
vendored
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue