(barr []byte, offset int)
| 913 | } |
| 914 | |
| 915 | func GetLineColFromOffset(barr []byte, offset int) (int, int) { |
| 916 | line := 1 |
| 917 | col := 1 |
| 918 | for i := 0; i < offset && i < len(barr); i++ { |
| 919 | if barr[i] == '\n' { |
| 920 | line++ |
| 921 | col = 1 |
| 922 | } else { |
| 923 | col++ |
| 924 | } |
| 925 | } |
| 926 | return line, col |
| 927 | } |
| 928 | |
| 929 | func FindStringInSlice(slice []string, val string) int { |
| 930 | for idx, v := range slice { |