Skip to content

Conversation

@leefernandes
Copy link
Owner

No description provided.

Copy link

Copilot AI left a 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.RWMutex to prevent race conditions when accessing global configuration
  • Fixed a circular reference bug in the Withf method 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_suffix convention 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.

Copy link

Copilot AI left a 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.

@leefernandes leefernandes requested a review from Copilot November 27, 2025 16:53
@leefernandes leefernandes merged commit 9304f41 into main Nov 27, 2025
8 checks passed
Copy link

Copilot AI left a 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]
Copy link

Copilot AI Nov 27, 2025

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.

Suggested change
// example error [example_trimprefixes_test.go:30.ExampleTrimCWD]
// example error [examples/example_trimprefixes_test.go:30.ExampleTrimCWD]

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants