Anonymous embedded struct produces invalid JSON: "go build -tags=go_json " #4461
zhuzaiye
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Warning: go build -tags=go_json
Code example (minimal reproducible)
Expected JSON output
{ "class_id": 150301, "class_name": "PreA1", "percent_rate": 0, "is_completed": false, "has_part_list": false, "part_items": [], "resource_items": [...] }Actual JSON output
macOS build produces invalid JSON, where the anonymous embedded struct is emitted as an object without a key:
{ "class_id": 150301, "class_name": "PreA1", "percent_rate": 0, "is_completed": false, { "has_part_list": false, "part_items": [], "resource_items": [ ... ] } }Environment
Build script:
Beta Was this translation helpful? Give feedback.
All reactions