| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…mitempty behavior
There was a problem hiding this comment.
This PR fixes a YAML marshaling issue where CSVConfig was always serialized as csv_config: {} even when empty, preventing the omitempty tag on the parent ParserConfig.CSV field from working correctly.
Key Changes:
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
(cherry picked from commit 0c21979)
| Back | FazBrowse Home | New Git URL |
Summary
Problem:
The CSVConfig struct was always being marshaled as csv_config: {} in YAML output, even when all configuration fields were empty. This prevented the omitempty tag on the parent ParserConfig.CSV field from working correctly.
Solution:
Created a custom CSVCheckFieldFunc type that implements the IsZeroer interface from the yaml package. By having IsZero() always return true, the function field is treated as empty for omitempty evaluation purposes.
Test Plan
Additional Information
For users: How does this change affect me?Summary by cubic
Fixed CSVConfig YAML omitempty so empty config no longer outputs csv_config: {}. Added CSVCheckFieldFunc with IsZero() to mark CheckField as empty during omitempty evaluation.
Written for commit 7210c07. Summary will update on new commits.