summaryrefslogtreecommitdiffhomepage
path: root/main.go
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2025-06-13 23:35:04 +0200
committerThomas Voss <mail@thomasvoss.com> 2025-06-13 23:35:04 +0200
commit294cb6062a0d3b0e38cc354152e14205638e65f6 (patch)
tree4d5c45a3c660ccc6e6eec89eb2f19a1946e3226d /main.go
parent53b23a865a209851d7360dac6962fa44c1aeed06 (diff)
Make more use of Try/Try2
Diffstat (limited to 'main.go')
-rw-r--r--main.go22
1 files changed, 4 insertions, 18 deletions
diff --git a/main.go b/main.go
index f5c039a..4d37cf2 100644
--- a/main.go
+++ b/main.go
@@ -48,29 +48,15 @@ func main() {
}
func watch() {
- path, err := os.Executable()
- if err != nil {
- log.Fatal(err)
- }
-
- ostat, err := os.Stat(path)
- if err != nil {
- log.Fatal(err)
- }
+ path := Try2(os.Executable())
+ ostat := Try2(os.Stat(path))
for {
- nstat, err := os.Stat(path)
- if err != nil {
- log.Fatal(err)
- }
-
+ nstat := Try2(os.Stat(path))
if nstat.ModTime() != ostat.ModTime() {
dbx.Close()
- if err := syscall.Exec(path, os.Args, os.Environ()); err != nil {
- log.Fatal(err)
- }
+ Try(syscall.Exec(path, os.Args, os.Environ()))
}
-
time.Sleep(1 * time.Second)
}
}