refactor: updated the executor lookup table #57

Manually merged
dananglin merged 1 commit from remove-the-executor-interface into main 2024-08-22 01:56:17 +01:00

1 commit

Author SHA1 Message Date
89e53bcc9f
refactor: update the executor lookup table
All checks were successful
Tests / test (pull_request) Successful in 16s
REUSE Compliance Check / check (push) Successful in 6s
Updated the executor lookup table by changing the map type from
map[string]Executor to map[string]func(string, bool, []string) error in
order to reduce the cost of initialising the map.

Previously the map initialised all the executors despite only needing
to run the single executor called by the command. The map now instead
maps the command to the function of type
'func(string, bool, []string) error' that will initialise and run the
executor called by the command. As a result of the change, the
Executor interface is no longer needed and has been removed.

PR: #57
2024-08-21 18:44:04 +01:00