NewRunner creates a new Runner around a given parser file and a temporary working directory.
(parserPath string)
| 39 | |
| 40 | // NewRunner creates a new Runner around a given parser file and a temporary working directory. |
| 41 | func NewRunner(parserPath string) (*Runner, error) { |
| 42 | // Create a temp directory for the runner. |
| 43 | dir, err := os.MkdirTemp(os.TempDir(), "run_differ_*") |
| 44 | if err != nil { |
| 45 | return nil, fmt.Errorf("failed to create temporary directory: %w", err) |
| 46 | } |
| 47 | |
| 48 | return &Runner{ |
| 49 | dir: dir, |
| 50 | parserPath: parserPath, |
| 51 | }, nil |
| 52 | } |
| 53 | |
| 54 | // Cleanup removes the working directory for the runner. |
| 55 | func (r *Runner) Cleanup() error { |
searching dependent graphs…