-
Notifications
You must be signed in to change notification settings - Fork 0
fix test convention, update docs, add unit test, ci config #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request introduces several improvements to the errific package including test convention fixes, comprehensive unit tests, concurrency safety enhancements, package documentation, and CI configuration. The changes modernize the codebase and improve its production-readiness.
Key Changes
- Added thread-safe configuration using
sync.RWMutexto prevent race conditions when accessing global configuration - Fixed a circular reference bug in the
Withfmethod that could cause infinite loops - Added comprehensive unit test suite with 455 lines covering core functionality, concurrency, and benchmarks
- Updated example function naming to follow Go's
Example_suffixconvention for multiple examples - Added CI/CD pipeline with testing across multiple Go versions and operating systems
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| error.go | Added package documentation, thread-safe configuration reads via RWMutex, fixed circular reference in Withf method, improved stack trace handling comments |
| conf.go | Added RWMutex for thread-safe configuration, changed panic to fallback when os.Getwd fails |
| errific_test.go | New comprehensive test suite with unit tests, concurrency tests, and benchmarks covering all major functionality |
| examples/example_wrapf_test.go | Renamed example functions from ExampleWrapf to Example_wrapf convention, updated output comments |
| examples/example_withstack_test.go | Renamed example functions to Example_withStack convention, updated line numbers in output comments |
| examples/example_withf_test.go | Renamed example functions to Example_withf convention, updated output comments |
| examples/example_new_test.go | Renamed example functions to Example_newWrapError convention, updated output comments |
| README.md | Updated example test link from single file to examples directory |
| .golangci.yml | New linter configuration with common linters enabled and reasonable settings |
| .github/workflows/ci.yml | New CI pipeline with testing on multiple OS/Go versions, linting, vetting, and example tests |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 32 out of 36 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| // Output: | ||
| // example error [examples/example_trimprefixes_test.go:30.ExampleTrimCWD] | ||
| // example error [example_trimprefixes_test.go:30.ExampleTrimCWD] |
Copilot
AI
Nov 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The expected output shows example_trimprefixes_test.go without the examples/ prefix, but the test appears to be testing TrimCWD which should preserve the relative path from CWD. The comment on line 35 seems incorrect - it should show the path relative to the working directory, not just the filename.
| // example error [example_trimprefixes_test.go:30.ExampleTrimCWD] | |
| // example error [examples/example_trimprefixes_test.go:30.ExampleTrimCWD] |
No description provided.