close pipe and then wait command in a separate goroutine

Mentioned in #5.
This commit is contained in:
Gokcehan 2016-09-16 15:22:39 +03:00
parent f82073603f
commit d51e99adc1

3
ui.go
View File

@ -353,7 +353,8 @@ func (ui *UI) loadFile(nav *Nav) {
log.Print(msg) log.Print(msg)
} }
defer cmd.Wait() defer out.Close()
go func() { defer cmd.Wait() }()
reader = out reader = out
} else { } else {
f, err := os.Open(path) f, err := os.Open(path)