defaults sets the default values of the builder before save.
()
| 272 | |
| 273 | // defaults sets the default values of the builder before save. |
| 274 | func (_c *MachineCreate) defaults() { |
| 275 | if _, ok := _c.mutation.CreatedAt(); !ok { |
| 276 | v := machine.DefaultCreatedAt() |
| 277 | _c.mutation.SetCreatedAt(v) |
| 278 | } |
| 279 | if _, ok := _c.mutation.UpdatedAt(); !ok { |
| 280 | v := machine.DefaultUpdatedAt() |
| 281 | _c.mutation.SetUpdatedAt(v) |
| 282 | } |
| 283 | if _, ok := _c.mutation.LastPush(); !ok { |
| 284 | v := machine.DefaultLastPush() |
| 285 | _c.mutation.SetLastPush(v) |
| 286 | } |
| 287 | if _, ok := _c.mutation.IsValidated(); !ok { |
| 288 | v := machine.DefaultIsValidated |
| 289 | _c.mutation.SetIsValidated(v) |
| 290 | } |
| 291 | if _, ok := _c.mutation.AuthType(); !ok { |
| 292 | v := machine.DefaultAuthType |
| 293 | _c.mutation.SetAuthType(v) |
| 294 | } |
| 295 | } |
| 296 | |
| 297 | // check runs all checks and user-defined validators on the builder. |
| 298 | func (_c *MachineCreate) check() error { |
no test coverage detected