Refactor the code to remove global variables

This commit is contained in:
Junegunn Choi committed 2024-05-07 16:58:17 +09:00
1 parent c5fb0c43f9
commit 4bedd33c59
7 files changed
+85 -76

No files matched your search

+3 -2
View File
@@ -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 {