Is it possible: to have one field in the struct, but different names for it during serialization/deserialization in Golang?
For example, I have the struct "Coordinates".
type Coordinates struct {
red int
}
For deserialization from JSON want to have a format like this:
{
"red":12
}
But when I will serialize the struct, the result should be like this one:
{
"r":12
}