close pipe and then wait command in a separate goroutine

Mentioned in #5.
This commit is contained in:
Gokcehan committed 2016-09-16 15:22:39 +03:00
1 parent f82073603f
commit d51e99adc1
1 file changed
+2 -1
+2 -1
View File
@@ -353,7 +353,8 @@ func (ui *UI) loadFile(nav *Nav) {
log.Print(msg)
}
defer cmd.Wait()
defer out.Close()
go func() { defer cmd.Wait() }()
reader = out
} else {
f, err := os.Open(path)