I have two structs:
// package a -- third party library
type UserProps struct {
FirstName `json:"first_name"`
LastName `json:"last_name"`
}
// package b -- my own package
type User struct {
a.UserProps
}
The problem is that UserProps is inherited from a 3rd party library, so I can't change its source code.
My question is can I extend the FirstName
tag from within the User
struct in package b so that the tag would eventually be as such json:"first_name",sql:"unique_index"
?
Also, note that I only want to extend the tag of only one field, FirstName.