op: complete the MacroOp example

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-10-14 23:18:49 +02:00
parent fa00b53e13
commit 4da6c57d83
+6 -1
View File
@@ -48,10 +48,15 @@ The MacroOp records a list of operations to be executed later:
ops := new(op.Ops) ops := new(op.Ops)
var macro op.MacroOp var macro op.MacroOp
macro.Record() macro.Record(ops)
// Record operations by adding them. // Record operations by adding them.
op.InvalidateOp{}.Add(ops) op.InvalidateOp{}.Add(ops)
... ...
// End recording.
macro.Stop()
// replay the recorded operations by calling Add:
macro.Add(ops)
*/ */
package op package op