Skip to content

Conversation

@osamingo
Copy link
Owner

@osamingo osamingo commented Jan 29, 2026

Summary

  • Add utility package for converting CSV++ data to JSON/YAML
  • Uses encoding/json/v2 (GOEXPERIMENT=jsonv2) and github.com/goccy/go-yaml

Features

  • RecordToMap: Convert CSV++ record to map[string]any
  • JSONEncoder: Streaming JSON output for large files
  • YAMLEncoder: Output as YAML array format
  • MarshalJSON / MarshalYAML: Convenience functions for batch conversion
  • WithDeterministic: Optional deterministic key ordering for JSON

Changes

  1. Add new csvpputil/ package
  2. Add GOEXPERIMENT=jsonv2 to CI workflow
  3. Update go-yaml to v1.19.2

Test plan

  • Unit tests added
  • Benchmarks added
  • Example tests added
  • Verify on CI

🤖 Generated with Claude Code

@osamingo osamingo self-assigned this Jan 29, 2026
@osamingo osamingo marked this pull request as ready for review January 29, 2026 15:20
osamingo and others added 6 commits January 30, 2026 00:23
- Add RecordToMap to convert CSV++ record to map[string]any
- Support all field types: Simple, Array, Structured, ArrayStructured

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add JSONEncoder for streaming JSON output
- Add MarshalJSON for batch conversion
- Add WithDeterministic option for deterministic key ordering

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add YAMLEncoder for YAML array output
- Add MarshalYAML for batch conversion
- Use github.com/goccy/go-yaml

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add benchmarks for Marshal and Encoder functions
- Add example tests for godoc documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Bump github.com/goccy/go-yaml from v1.19.1 to v1.19.2

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add GOEXPERIMENT env var for encoding/json/v2 support
- Apply to both test and lint jobs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@osamingo osamingo merged commit 5613012 into main Jan 29, 2026
3 checks passed
@osamingo osamingo deleted the feat/add-csvpputil branch January 29, 2026 15:25
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.

2 participants