File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ import (
14
14
)
15
15
16
16
var (
17
- sectionHeader = regexp .MustCompile (`^\[([^]]+)\]$ ` )
17
+ sectionHeader = regexp .MustCompile (`^\[([^]]+)\]` )
18
18
interpolater = regexp .MustCompile (`%\(([^)]*)\)s` )
19
19
)
20
20
@@ -47,7 +47,7 @@ type ConfigParser struct {
47
47
48
48
// Keys returns a sorted slice of keys
49
49
func (d Dict ) Keys () []string {
50
- var keys []string
50
+ keys := make ( []string , 0 , len ( d ))
51
51
52
52
for key := range d {
53
53
keys = append (keys , key )
@@ -228,7 +228,7 @@ func (p *ConfigParser) ParseReader(in io.Reader) error {
228
228
}
229
229
230
230
if match := sectionHeader .FindStringSubmatch (line ); len (match ) > 0 {
231
- section := match [1 ]
231
+ section := p . opt . inlineCommentPrefixes . Split ( match [1 ])
232
232
if section == p .opt .defaultSection {
233
233
curSect = p .defaults
234
234
} else if _ , present := p .config [section ]; ! present {
You can’t perform that action at this time.
0 commit comments