findLine returns the line number for the given offset into data.
(data []byte, offset int64)
| 73 | |
| 74 | // findLine returns the line number for the given offset into data. |
| 75 | func findLine(data []byte, offset int64) (line int) { |
| 76 | line = 1 |
| 77 | for i, r := range string(data) { |
| 78 | if int64(i) >= offset { |
| 79 | return |
| 80 | } |
| 81 | if r == '\n' { |
| 82 | line++ |
| 83 | } |
| 84 | } |
| 85 | return |
| 86 | } |
| 87 | |
| 88 | // testMatcher controls skipping and chain config assignment to tests. |
| 89 | type testMatcher struct { |