UnmarshalIdentifier can be optionally implemented to control unmarshaling of the primary field from a string. The order of operations for unmarshaling the primary field is: 1. Use UnmarshalIdentifier if it is implemented 2. Use the value directly if it is a string 3. Fail
| 383 | // 2. Use the value directly if it is a string |
| 384 | // 3. Fail |
| 385 | type UnmarshalIdentifier interface { |
| 386 | UnmarshalID(id string) error |
| 387 | } |
| 388 | |
| 389 | // MarshalType can be optionally implemented to control marshaling of the type field. |
| 390 | // |