(source string, loc ast.Loc)
| 516 | } |
| 517 | |
| 518 | func sourceFromLoc(source string, loc ast.Loc) string { |
| 519 | if loc.Start < 0 || loc.End < 0 || loc.Start >= len(source) { |
| 520 | return "" |
| 521 | } |
| 522 | end := min(loc.End, len(source)) |
| 523 | return strings.TrimSpace(source[loc.Start:end]) |
| 524 | } |
| 525 | |
| 526 | func positionFromByteOffset(start *storepb.Position, source string, offset int) *storepb.Position { |
| 527 | if offset < 0 { |
no outgoing calls
no test coverage detected