Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Normalize ¶
func Normalize(tree interface{}) error
Normalize allows normalizing all the unions encountered while walking through the whole struct tree. Union normalizing works according to the following rules: - When only one field of the union is set and no discriminator is set, set the discriminator according to the union value. - When several fields are set and a discriminator is set, remove (== reset to zero value) all the values that do not match the discriminator. - When only one union value is set and it matches discriminator, just do nothing. - In other case, something is inconsistent or ambiguous: an error is thrown.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.