RestrictMaxTime sets the template's max time to the given value if it's earlier than the maxtime already present.
(t time.Time)
| 155 | // RestrictMaxTime sets the template's max time to the given value if |
| 156 | // it's earlier than the maxtime already present. |
| 157 | func (tpl *Template) RestrictMaxTime(t time.Time) { |
| 158 | ms := bc.Millis(t) |
| 159 | if ms < tpl.MaxTimeMS { |
| 160 | tpl.MaxTimeMS = ms |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | // OnRollback registers a function that can be |
| 165 | // used to attempt to undo any side effects of building |