update example

This commit is contained in:
joesis
2017-06-20 14:25:29 +08:00
parent 88b0d4795c
commit ef254071ef
+10 -6
View File
@@ -10,6 +10,16 @@ import (
)
func main() {
file, err := os.Create("out.txt")
if err != nil {
fmt.Println("Couldn't create out.txt")
return
}
defer file.Close()
onExit := func() {
file.Write([]byte("On Exit..."))
file.Sync()
}
// Should be called at the very beginning of main().
systray.Run(onReady, onExit)
}
@@ -61,9 +71,3 @@ func onReady() {
}
}()
}
func onExit() {
file, _ := os.Create("out.txt")
defer file.Close()
file.Write([]byte("On Exit..."))
}