Maybe allows the method call to be optional. Not calling an optional method will not cause an error while asserting expectations
()
| 190 | // Maybe allows the method call to be optional. Not calling an optional method |
| 191 | // will not cause an error while asserting expectations |
| 192 | func (c *Call) Maybe() *Call { |
| 193 | c.lock() |
| 194 | defer c.unlock() |
| 195 | c.optional = true |
| 196 | return c |
| 197 | } |
| 198 | |
| 199 | // On chains a new expectation description onto the mocked interface. This |
| 200 | // allows syntax like. |