CommitAsNeeded execute a Commit only if necessary. This function is useful to avoid getting an error if the Entity is already in sync with the repository.
(repo repository.ClockedRepo)
| 436 | // CommitAsNeeded execute a Commit only if necessary. This function is useful to avoid getting an error if the Entity |
| 437 | // is already in sync with the repository. |
| 438 | func (e *Entity) CommitAsNeeded(repo repository.ClockedRepo) error { |
| 439 | if e.NeedCommit() { |
| 440 | return e.Commit(repo) |
| 441 | } |
| 442 | return nil |
| 443 | } |
| 444 | |
| 445 | // Commit write the appended operations in the repository |
| 446 | func (e *Entity) Commit(repo repository.ClockedRepo) error { |
nothing calls this directly
no test coverage detected