File tree 2 files changed +7
-7
lines changed
2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import (
12
12
// * line of comment
13
13
// * line without any quotes
14
14
// * line(s) with quoted strings, which are kept together to form a single "line of configuration"
15
- var linesRe = regexp .MustCompile (`(\n|\s*// [^\n]*\n|[^'"\n]*\n|([^"'\n]*("(\\"|[^"])*"|'(\\'|[^'])*')[^"'\n]*)*\n)` )
15
+ var linesRe = regexp .MustCompile (`(\n|\s*# [^\n]*\n|[^'"\n]*\n|([^"'\n]*("(\\"|[^"])*"|'(\\'|[^'])*')[^"'\n]*)*\n)` )
16
16
17
17
func prefix (in string , emptyNewline bool ) string {
18
18
if len (in ) == 0 {
Original file line number Diff line number Diff line change @@ -30,19 +30,19 @@ func TestPrefix(t *testing.T) {
30
30
},
31
31
{
32
32
name : "simple attribute with comment" ,
33
- input : `// comment
33
+ input : `# comment
34
34
value => 3.1415
35
35
` ,
36
36
37
37
want : `
38
- // comment
38
+ # comment
39
39
value => 3.1415
40
40
` ,
41
41
},
42
42
{
43
43
name : "block" ,
44
44
input : `add_field {
45
- // comment
45
+ # comment
46
46
value => 3.1415
47
47
}
48
48
@@ -51,7 +51,7 @@ add_tag => [ "foobar" ]
51
51
52
52
want : `
53
53
add_field {
54
- // comment
54
+ # comment
55
55
value => 3.1415
56
56
}
57
57
@@ -90,12 +90,12 @@ lines'
90
90
},
91
91
{
92
92
name : "comment with double and single quote" ,
93
- input : `// comment with " and '
93
+ input : `# comment with " and '
94
94
othervalue => 3.1415
95
95
` ,
96
96
97
97
want : `
98
- // comment with " and '
98
+ # comment with " and '
99
99
othervalue => 3.1415
100
100
` ,
101
101
},
You can’t perform that action at this time.
0 commit comments