What problem does it solve?
Reading JSON files in Go often fails due to missing files, permission issues, or malformed data, and vague errors slow debugging. This Skill provides clear, actionable error handling, validation, and context so developers can reliably load configuration and data files.
Core Features & Use Cases
- Comprehensive Error Handling: Distinguish file-not-found, permission, and other I/O errors with contextual messages that include the file path and operation.
- JSON Parsing Insights: Surface syntax and type errors with offsets/fields; validate required fields after unmarshal to ensure data integrity.
- Reusability & Defaults: Provide generic loaders, optional defaults, and patterns for pointer fields and validation of slices/maps.
- Use Case: Load a config.json at startup, fail fast with a precise error if the file is missing or malformed, or apply safe defaults when appropriate.
Quick Start
Ask to load a JSON config file in Go with specific handling for not found, permission, and syntax/type errors, validating required fields and returning actionable messages.