I have fields that we forgot to initially define a msgp tag for, so our msgp generation is using the full name of the field. This can be quite long, and it would be ideal to have a built-in way to rename the msgp tag - this would add a configuration in the tag for old aliases. The generated code would then support unmarshaling into a particular field using that old tag. Marshalling would use the new tag.
Example:
type Name struct {
CurrentName string `msg:"CurrentName"`
}
has a quite long field, causing storage bloat. We could add an alias:
type Name struct {
CurrentName string `msg:"cn,aliases=CurrentName"`
}
To be rollback safe, one might want to add the new name as an alias first (i.e. msg:"CurrentName,aliases=cn").
It could also support multiple aliases that are ; delimited.
I have fields that we forgot to initially define a
msgptag for, so our msgp generation is using the full name of the field. This can be quite long, and it would be ideal to have a built-in way to rename the msgp tag - this would add a configuration in the tag for old aliases. The generated code would then support unmarshaling into a particular field using that old tag. Marshalling would use the new tag.Example:
has a quite long field, causing storage bloat. We could add an alias:
To be rollback safe, one might want to add the new name as an alias first (i.e.
msg:"CurrentName,aliases=cn").It could also support multiple aliases that are
;delimited.