Skip to content
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

feat: adds String implementation for ApiError and FileWrapper #96

Merged
merged 4 commits into from
Dec 18, 2024

Conversation

haseeb-mhr
Copy link
Collaborator

@haseeb-mhr haseeb-mhr commented Dec 17, 2024

What

This PR implements String() methods for the ApiError and FileWrapper structs. By adding these methods, the structs now support customizable and readable string representations, allowing developers to print or log their content in a human-friendly format.

Why

Previously, printing or logging ApiError and FileWrapper resulted in raw struct output, which could be difficult to interpret and debug, especially when dealing with complex or nested data. By implementing String() methods:

  • Developers gain clearer, formatted representations of these structs, improving debugging and logging capabilities.
  • It enhances usability by aligning with Go's standard practices for pretty-printing objects.
  • This provides better insights into the contents of ApiError and FileWrapper without requiring manual struct formatting or additional debugging tools.

Type of change

Select multiple if applicable.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause a breaking change)
  • Tests (adds or updates tests)
  • Documentation (adds or updates documentation)
  • Refactor (style improvements, performance improvements, code refactoring)
  • Revert (reverts a commit)
  • CI/Build (adds or updates a script, change in external dependencies)

Breaking change

No breaking changes were introduced in this PR.

Testing

Added new unit tests for typed additional Properties.

Checklist

  • My code follows the coding conventions
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added new unit tests

@haseeb-mhr haseeb-mhr added enhancement New feature or request priority-high labels Dec 17, 2024
@haseeb-mhr haseeb-mhr self-assigned this Dec 17, 2024
@haseeb-mhr haseeb-mhr marked this pull request as ready for review December 17, 2024 13:04
@haseeb-mhr haseeb-mhr merged commit 3131a55 into main Dec 18, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority-high
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants