From 4bedd33c593ab0cb750e17c42750048904fdf7fb Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Tue, 7 May 2024 16:58:17 +0900 Subject: Refactor the code to remove global variables --- src/reader.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/reader.go') 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 { -- cgit v1.2.3