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

fix(clone): Ignore reflect.rtype #24

Merged
merged 2 commits into from
Dec 9, 2024
Merged

Conversation

m-mizutani
Copy link
Owner

Original issue: #23
This pull request introduces changes to the clone.go and clone_test.go files to enhance the handling of certain types and add new test cases. The key changes involve the introduction of a map to ignore specific types during cloning operations and the addition of new test functions.

Enhancements in type handling:

  • clone.go: Added a new ignoreTypes map to list types that should not be redacted, such as *reflect.rtype, to prevent panics caused by copying certain types.
  • clone.go: Modified the clone function to check against the ignoreTypes map and return the source value if it matches an ignored type.

Additions to test coverage:

  • clone_test.go: Added a new test function TestCloneFunc to verify that functions are correctly cloned without modification.
  • clone_test.go: Added a new test function TestUnmarshalTypeError to ensure that JSON unmarshalling errors are correctly logged and handled.

@m-mizutani m-mizutani merged commit 351da57 into main Dec 9, 2024
5 checks passed
@m-mizutani m-mizutani deleted the fix/json-unmarshal-type-error branch December 9, 2024 01:49
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.

1 participant