RecoverMidExecutionCommand returns a virtual command, used to describe the a subcommand that was created before the start of the trace
(ctx context.Context, c *path.Capture, dat interface{})
| 659 | // RecoverMidExecutionCommand returns a virtual command, used to describe the |
| 660 | // a subcommand that was created before the start of the trace |
| 661 | func (API) RecoverMidExecutionCommand(ctx context.Context, c *path.Capture, dat interface{}) (api.Cmd, error) { |
| 662 | cr, ok := dat.(CommandReferenceʳ) |
| 663 | if !ok { |
| 664 | return nil, fmt.Errorf("Not a command reference") |
| 665 | } |
| 666 | |
| 667 | ctx = capture.Put(ctx, c) |
| 668 | st, err := capture.NewState(ctx) |
| 669 | if err != nil { |
| 670 | return nil, err |
| 671 | } |
| 672 | s := GetState(st) |
| 673 | |
| 674 | cb := CommandBuilder{Thread: 0, Arena: st.Arena} |
| 675 | _, a, err := AddCommand(ctx, cb, cr.Buffer(), st, st, GetCommandArgs(ctx, cr, s)) |
| 676 | if err != nil { |
| 677 | return nil, log.Errf(ctx, err, "Invalid Command") |
| 678 | } |
| 679 | return a, nil |
| 680 | } |
| 681 | |
| 682 | // Interface check |
| 683 | var _ sync.SynchronizedAPI = &API{} |
nothing calls this directly
no test coverage detected