stripValidationLocations removes leading "[file:line] " prefixes from error messages. Validation errors now include DSL declaration locations when available; most test cases assert error semantics and should remain stable when line numbers change due to unrelated edits.
(message string)
| 9 | // test cases assert error semantics and should remain stable when line numbers |
| 10 | // change due to unrelated edits. |
| 11 | func stripValidationLocations(message string) string { |
| 12 | lines := strings.Split(message, "\n") |
| 13 | for i, line := range lines { |
| 14 | if !strings.HasPrefix(line, "[") { |
| 15 | continue |
| 16 | } |
| 17 | end := strings.Index(line, "] ") |
| 18 | if end == -1 { |
| 19 | continue |
| 20 | } |
| 21 | lines[i] = line[end+2:] |
| 22 | } |
| 23 | return strings.Join(lines, "\n") |
| 24 | } |
no outgoing calls
no test coverage detected