github
59 of 86 new or added lines in 2 files covered. (68.6%)
1299 of 1515 relevant lines covered (85.74%)
3197.54 hits per line
1 |
package ja
|
|
2 |
|
|
3 |
import (
|
|
4 |
"bufio"
|
|
5 |
"bytes"
|
|
6 |
"strings"
|
|
7 |
) |
|
8 |
|
|
|
func loadConfig(b []byte) ([]string, error) { |
4✔ |
|
s := bufio.NewScanner(bytes.NewReader(b)) |
4✔ |
|
var ret []string |
4✔ |
|
for s.Scan() {
|
1,098✔ |
|
line := s.Text() |
1,094✔ |
|
if strings.HasPrefix(line, "#") { |
1,916✔ |
|
continue
|
822✔ |
16 |
} |
|
|
if i := strings.Index(line, "#"); i > 0 { |
272✔ |
NEW
|
line = line[:i] |
× |
NEW
|
} |
× |
|
if line == "" { |
272✔ |
NEW
|
continue
|
× |
22 |
} |
|
|
ret = append(ret, line)
|
272✔ |
24 |
} |
|
|
return ret, s.Err()
|
4✔ |
26 |
} |