mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
The previous code did not work on Windows OS. Because the file was open in the process and therefore could not be removed.
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user