Skip to content

Commit a634443

Browse files
committed
fix(parser): remove unused ParseError type
ParseError and NewParseError were defined in internal/parser/types.go but never raised by Parse() or splitAndClassify(), which always return plain fmt.Errorf strings. No caller checked for ParseError via errors.As or type assertions either. The parser delegates to pglex tokenization which doesn't produce parse errors, so the type had no path to being used. Remove the dead code.
1 parent 78c2f2a commit a634443

1 file changed

Lines changed: 0 additions & 24 deletions

File tree

internal/parser/types.go

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,9 @@
11
package parser
22

33
import (
4-
"fmt"
5-
64
"github.com/cybertec-postgresql/pgcov/internal/discovery"
75
)
86

9-
// ParseError represents SQL parsing failure
10-
type ParseError struct {
11-
File string
12-
Line int
13-
Column int
14-
Message string
15-
}
16-
17-
func (e *ParseError) Error() string {
18-
return fmt.Sprintf("%s:%d:%d: %s", e.File, e.Line, e.Column, e.Message)
19-
}
20-
21-
// NewParseError creates a new ParseError
22-
func NewParseError(file string, line, column int, message string) *ParseError {
23-
return &ParseError{
24-
File: file,
25-
Line: line,
26-
Column: column,
27-
Message: message,
28-
}
29-
}
30-
317
// ParsedSQL represents a successfully parsed SQL file
328
type ParsedSQL struct {
339
File *discovery.DiscoveredFile

0 commit comments

Comments
 (0)