Skip to content

Conversation

@denisvmedia
Copy link
Member

Description

The main README was missing a reference to the package, which provides JSON serialization capabilities for errx errors. This PR adds comprehensive documentation about the json package to make it more discoverable for users.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring
  • Test improvement

Related Issues

N/A - Documentation improvement

Changes Made

  • Added JSON serialization as the fifth key capability in the Overview section
  • Added JSON serialization feature to the Features list
  • Added a comprehensive JSON Serialization section with code examples
  • Included configuration options (WithMaxDepth, WithMaxStackFrames, WithIncludeStandardErrors)
  • Listed key features of the json package
  • Updated the zero dependencies note to mention both stacktrace and json packages
  • Positioned the JSON section logically between stacktrace and compat sections

Testing

Test Coverage

  • All new code is covered by tests (N/A - documentation only)
  • All existing tests pass (go test ./...)
  • Tests pass with race detector (go test -race ./...) (N/A - documentation only)

Manual Testing

  • Verified README renders correctly in markdown preview
  • Confirmed all links are valid
  • Checked code examples for syntax correctness

Documentation

  • Code is documented with godoc comments (N/A - documentation only)
  • README updated
  • CHANGELOG updated
  • Examples added/updated (N/A - documentation only)

Code Quality

  • Code follows the project's style guidelines
  • golangci-lint passes (N/A - documentation only)
  • go vet passes (N/A - documentation only)
  • go fmt has been run (N/A - documentation only)
  • No new warnings introduced

Breaking Changes

Does this PR introduce breaking changes?

  • Yes
  • No

Performance Impact

  • No performance impact
  • Performance improvement (include benchmarks)
  • Potential performance regression (explain why acceptable)

Additional Notes

This is a documentation-only change that improves discoverability of the existing json package. The json package itself has been in the repository but was not mentioned in the main README, making it less visible to users.

Checklist

  • I have read the CONTRIBUTING guidelines
  • My code follows the code style of this project
  • I have added tests that prove my fix/feature works (N/A - documentation only)
  • All tests pass locally
  • I have updated the documentation accordingly
  • I have added an entry to CHANGELOG.md

- Add JSON serialization as fifth key capability in Overview
- Add JSON serialization feature to Features list
- Add comprehensive JSON Serialization section with examples
- Include configuration options and key features
- Update zero dependencies note to mention json package
- Position JSON section between stacktrace and compat sections
Copilot AI review requested due to automatic review settings January 15, 2026 10:41
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 PR adds comprehensive documentation for the json subpackage to the main README, improving discoverability of the JSON serialization capabilities.

Changes:

  • Updated overview to mention five key capabilities instead of four
  • Added JSON serialization to the features list
  • Added a comprehensive JSON Serialization section with usage examples and configuration options

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

jsonBytes, _ := errxjson.Marshal(err)

// Pretty print
jsonBytes, _ := errxjson.MarshalIndent(err, "", " ")
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable jsonBytes is being redeclared here, which will shadow the previous declaration on line 358. The second assignment should use = instead of :=, or use a different variable name to avoid confusion.

Suggested change
jsonBytes, _ := errxjson.MarshalIndent(err, "", " ")
jsonBytes, _ = errxjson.MarshalIndent(err, "", " ")

Copilot uses AI. Check for mistakes.
@denisvmedia denisvmedia added this pull request to the merge queue Jan 15, 2026
Merged via the queue into master with commit cd80dde Jan 15, 2026
8 checks passed
@denisvmedia denisvmedia deleted the docs/add-json-package-reference branch January 15, 2026 10:45
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