File tree 2 files changed +14
-4
lines changed 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -25,10 +25,10 @@ func Parse(data []string) (SectionList, error) {
25
25
list = append (list , Standard {})
26
26
} else if s == "newline" {
27
27
list = append (list , NewLine {})
28
- } else if strings .HasPrefix (s , "prefix(" ) && len (s ) > 8 {
29
- list = append (list , Custom {s [7 : len (s )- 1 ]})
30
- } else if strings .HasPrefix (s , "commentline(" ) && len (s ) > 13 {
31
- list = append (list , Custom {s [12 : len (s )- 1 ]})
28
+ } else if strings .HasPrefix (s , "prefix(" ) && len (d ) > 8 {
29
+ list = append (list , Custom {d [7 : len (d )- 1 ]})
30
+ } else if strings .HasPrefix (s , "commentline(" ) && len (d ) > 13 {
31
+ list = append (list , Custom {d [12 : len (d )- 1 ]})
32
32
} else {
33
33
errString += fmt .Sprintf (" %s" , s )
34
34
}
Original file line number Diff line number Diff line change @@ -25,6 +25,16 @@ func TestParse(t *testing.T) {
25
25
expectedSection : SectionList {Custom {"go" }},
26
26
expectedError : nil ,
27
27
},
28
+ {
29
+ input : []string {"prefix(go-UPPER-case)" },
30
+ expectedSection : SectionList {Custom {"go-UPPER-case" }},
31
+ expectedError : nil ,
32
+ },
33
+ {
34
+ input : []string {"PREFIX(go-UPPER-case)" },
35
+ expectedSection : SectionList {Custom {"go-UPPER-case" }},
36
+ expectedError : nil ,
37
+ },
28
38
{
29
39
input : []string {"prefix(" },
30
40
expectedSection : nil ,
You can’t perform that action at this time.
0 commit comments