go-defaults
go-defaults copied to clipboard
How to take default value of a field derived from other fields of same struct
How can I get the default value of one field derived from other fields of same struct, For example:
type User struct { Name string FirstName string LastName string } Here the default value of Name will be derived from FirstName and LastName i.e., Name = concat(FirstName,' ',LastName).
Is there any way to achieve this? @mcuadros Let me know