Problem
The Go parser does not extract exception classname metadata, resulting in incomplete error tracking data.
File Location
src/main/java/io/err0/client/languages/GolangSourceCodeParse.java:324
// TODO: extract exception classname meta data
Context
Go uses explicit error handling with the error interface:
// Standard error returns
func doSomething() error {
return errors.New("something went wrong")
}
// Custom error types
type MyError struct {
message string
}
// Error interface implementation
func (e *MyError) Error() string {
return e.message
}
// Standard library errors
return fmt.Errorf("failed: %w", err)
Expected Behavior
Extract and store:
- Error type names from return signatures
- Custom error struct names
- Standard library error types
- Wrapped error information
Implementation Guidance
-
Identify Go error patterns:
error return types
errors.New() calls
fmt.Errorf() calls
- Custom error struct definitions
- Error type assertions
-
Extract error information:
- For custom types: extract struct name
- For standard errors: mark as "error"
- For wrapped errors: extract wrapped type if available
-
Store in token metadata
-
Handle Go's convention of returning (result, error) tuples
Test Cases Needed
Add to src/test/testdata/ for Go:
- Function returning error
- Custom error type
- errors.New() usage
- fmt.Errorf() usage
- Error wrapping with %w
Reference Files
src/main/java/io/err0/client/languages/JavaSourceCodeParse.java (exception pattern reference)
- Existing Go test data in
src/test/testdata/
Acceptance Criteria
Problem
The Go parser does not extract exception classname metadata, resulting in incomplete error tracking data.
File Location
src/main/java/io/err0/client/languages/GolangSourceCodeParse.java:324// TODO: extract exception classname meta dataContext
Go uses explicit error handling with the
errorinterface:Expected Behavior
Extract and store:
Implementation Guidance
Identify Go error patterns:
errorreturn typeserrors.New()callsfmt.Errorf()callsExtract error information:
Store in token metadata
Handle Go's convention of returning
(result, error)tuplesTest Cases Needed
Add to
src/test/testdata/for Go:Reference Files
src/main/java/io/err0/client/languages/JavaSourceCodeParse.java(exception pattern reference)src/test/testdata/Acceptance Criteria