crunchloop / crunchloop/devcontainer
config: add json struct tags to ResolvedConfig for stable CLI JSON output
- Ngôn ngữ chính
- Go
- Star
- 5
- Fork
- 0
- Merge trung bình
- 6 giờ 17 phút
- Pull request đã merge (30 ngày)
- 15
Mô tả
\`config.ResolvedConfig\` has no \`json:\` struct tags, so \`encoding/json\` emits Go-PascalCase field names (\`DevcontainerID\`, \`Source\`, \`ContainerWorkspaceFolder\`, …).
That's fine when the library is embedded, but it makes \`devcontainer read-configuration\` output awkward for anyone piping into \`jq\` — and it's not a stable shape (a struct field rename silently changes the JSON key).
Add explicit \`json:\` tags using camelCase / spec-style names where the spec defines them (\`workspaceFolder\`, \`remoteUser\`, \`containerEnv\`, etc.), and our own conventions for fields not in the spec (\`devcontainerId\`, \`source\`, \`warnings\`).
Benefits:
- Stable CLI output shape, usable with \`jq\`
- Spec-aligned where it makes sense
- Cheaper for any future programmatic consumer
Worth verifying nothing else in the repo (tests, examples) depends on the current PascalCase JSON.
Hướng dẫn đóng góp
Hướng nghiên cứu
Xác định config.ResolvedConfig và kiểm tra lệnh read-configuration để xem encoding/json hiện đang expose các trường của nó như thế nào. Tìm trong các test và ví dụ của repository các khóa JSON dạng PascalCase, sau đó xác minh rằng output sử dụng các tên được yêu cầu ở dạng camelCase hoặc theo kiểu spec mà không làm hỏng các kỳ vọng hiện có.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- go
- Lĩnh vực
- cli
- Loại issue
- Tính năng
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 68/100