I am very new to Go, and I was exploring the possibility of using one of my microservices. I was wondering how Go converts objects to Json and back to Json. But, unfortunately, I found that setting the names of the output fields is difficult using tag names.
type MyStruct strust{
MyName string
}
converted to json
{
"MyName" : "somestring"
}
But we follow a naming strategy for the entire api through the Organization to follow snake_case
{
"my_name" : "somestring"
}
In my organization is considered valid.
I started using type tags json:"my_name,omitempty", etc. at field level.
I would like to know if there is a way to configure it at the global level of the project, so I do not want to take care of this at every object and its field level.