You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Struct values encode as JSON objects. Each exported struct field becomes a member of the object, using the field name as the object key, unless the field is omitted for one of the reasons given below.
the field
name
is excluded from the result because start with a lower case .Does this issue reproduce with the latest release?
yes
What did you do?
a example , 99% inspired by the example from your documentation
https://go.dev/play/p/ZaxfyRsRg_g
What did you expect to see?
{"ID":1,"name":"Reds","Colors":["Crimson","Red","Ruby","Maroon"]}
What did you see instead?
json result has only 2 fields
{"ID":1,"Colors":["Crimson","Red","Ruby","Maroon"]}
this issue is so obvious , that i think i miss a word in this documentation https://pkg.go.dev/encoding/json#Marshal
but i read twice , and i did not anything
The text was updated successfully, but these errors were encountered: