diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2024-05-07 16:58:17 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2024-05-07 16:58:17 +0900 |
commit | 4bedd33c593ab0cb750e17c42750048904fdf7fb (patch) | |
tree | 10ef749a51b1b947f5bb34eb154c5f992a50edbb /src/reader.go | |
parent | c5fb0c43f9222e72ff00290162b68e34a8f0d5d7 (diff) |
Refactor the code to remove global variables
Diffstat (limited to 'src/reader.go')
-rw-r--r-- | src/reader.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/reader.go b/src/reader.go index 6092087e..99a609e2 100644 --- a/src/reader.go +++ b/src/reader.go @@ -86,11 +86,12 @@ func (r *Reader) terminate() { r.mutex.Unlock() } -func (r *Reader) restart(command string, environ []string) { +func (r *Reader) restart(command commandSpec, environ []string) { r.event = int32(EvtReady) r.startEventPoller() - success := r.readFromCommand(command, environ) + success := r.readFromCommand(command.command, environ) r.fin(success) + removeFiles(command.tempFiles) } func (r *Reader) readChannel(inputChan chan string) bool { |