counter body: increments an integer carried in State.Data.
()
| 8 | |
| 9 | // counter body: increments an integer carried in State.Data. |
| 10 | func counter() StepFunc { |
| 11 | return func(ctx context.Context, in State) (State, error) { |
| 12 | n, _ := strconv.Atoi(in.String()) |
| 13 | in.Data = []byte(strconv.Itoa(n + 1)) |
| 14 | return in, nil |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | func TestLoopUntil(t *testing.T) { |
| 19 | step := Loop(counter(), |
no test coverage detected
searching dependent graphs…