I see what might be a problem, however: determining the difference between a zero-value in a struct that was supplied intentionally, or one that was left unspecified.
To clarify what I mean, in the example on that page the following line doesn't produce the right answer:
p := defaults.NewWithDefaults(Person{ConvictedFelon: false}).(Person)
Of course, you could perform the assignment after the defaults have been initialized, but then you're giving up the optional struct initialization that Go provides. I'll have to think about how you could solve this. In the meanwhile, I'll open an issue on Github.That, and judicious use of a New() function to construct and initialize types, help make up for the lack of default attributes in structs.