The previous code did not work on Windows OS. Because the file was open in the process and therefore could not be removed.

Ehsan Gifani 2020-12-09 21:24:34 +03:30
parent f202e9df34
commit ef150bf657

@ -21,6 +21,7 @@ func main() {
panic(err)
}
defer os.Remove(f.Name())
defer f.Close()
sig := make(chan os.Signal, 1)
signal.Notify(sig, os.Interrupt)
<-sig