cmdbox
cmdbox copied to clipboard
Add util.TimeOut() method
Command line utilities typically never get the type of attention they
need when it comes to timing out operations cleanly. For this reason,
util.TimeOut()
needs to be added. It should take a varying number of
arguments but always requires the duration (in time.Sleep
notation).
util.TimeOut(10 * time.Second)
util.TimeOut(10 * time.Second, "some message")
util.TimeOut(10 * time.Second, util.TimeOutFunc)
Keeping it with a variadic function signature will ensure that it remains compatible over time with the most high-level things.