i would know if json.Marshal Put Uppercase a the first letter of each name fields ? I need to encode some data with just a lowercase at each field name first letter.
just:
{
"name":"thomas"
}
instead of:
{
"Name":"thomas"
}
Thanks !
i would know if json.Marshal Put Uppercase a the first letter of each name fields ? I need to encode some data with just a lowercase at each field name first letter.
just:
{
"name":"thomas"
}
instead of:
{
"Name":"thomas"
}
Thanks !
You have to add an annotation to the Name
field.
Supposing your struct is:
type User struct {
Name string
}
You have to change it to:
type User struct {
Name string `json:"name"`
}
The json marshaller will replace Name
with name