SetDefaults implements defaults.Setter interface
()
| 41 | |
| 42 | // SetDefaults implements defaults.Setter interface |
| 43 | func (s *OtherStruct) SetDefaults() { |
| 44 | if defaults.CanUpdate(s.Random) { // Check if it's a zero value (recommended) |
| 45 | s.Random = rand.Int() // Set a dynamic value |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | func main() { |
| 50 | obj := &Sample{} |
nothing calls this directly
no test coverage detected