| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
This PR refactors the CSVConfig struct by making its CheckField field unexported (renamed to checkField) and introducing a SetCheckField setter method. This change allows the omitempty YAML tag on the parent ParserConfig.CSV field to work correctly, preventing empty csv_config: {} from appearing in YAML output when all configuration fields are empty.
Key Changes:
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file| File | Description |
|---|---|
| src/go/plugin/go.d/pkg/logs/csv.go | Renamed CheckField to checkField and added SetCheckField setter method |
| src/go/plugin/go.d/pkg/logs/csv_test.go | Updated test to directly assign to unexported checkField |
| src/go/plugin/go.d/collector/weblog/collector.go | Refactored to use SetCheckField after struct initialization |
| src/go/plugin/go.d/collector/weblog/parser_test.go | Updated test to use SetCheckField method |
| src/go/plugin/go.d/collector/weblog/collector_test.go | Updated multiple test functions to use SetCheckField method |
| src/go/plugin/go.d/collector/squidlog/collector.go | Refactored to use SetCheckField after struct initialization |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
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.
The issue was caused by the exported CheckField function field, which cannot be marshaled to YAML but still prevented the struct from being considered "empty" for omitempty purposes.
Summary
Test Plan
Additional Information
For users: How does this change affect me?Summary by cubic
Fix YAML marshaling of CSVConfig so empty configs are omitted from output. Made the function field internal and added a setter to keep it out of serialization.
Written for commit e7ed7a2. Summary will update on new commits.