diff options
Diffstat (limited to 'config/section.go')
| -rw-r--r-- | config/section.go | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/config/section.go b/config/section.go deleted file mode 100644 index 66adf011..00000000 --- a/config/section.go +++ /dev/null @@ -1,41 +0,0 @@ -package config - -import ( - "bytes" - "errors" - "fmt" - "strings" -) - -func (p *configParser) parseSection() error { - var name bytes.Buffer - - for { - ch, err := p.nextChar() - if err != nil { - return errors.New("unexpected EOF in section header") - } - - if ch == ']' { - section := name.String() - if !isValidSection(section) { - return fmt.Errorf("invalid section name: %q", section) - } - - p.currentSection = strings.ToLower(section) - p.currentSubsec = "" - - return nil - } - - if isWhitespace(ch) { - return p.parseExtendedSection(&name) - } - - if !isKeyChar(ch) && ch != '.' { - return fmt.Errorf("invalid character in section name: %q", ch) - } - - name.WriteByte(toLower(ch)) - } -} |
