()
| 22 | ) |
| 23 | |
| 24 | func main() { |
| 25 | // On Windows, this allows the same binary to act as an elevated helper |
| 26 | // process for staging updates when triggered via UAC. On other platforms |
| 27 | // this is a no-op. |
| 28 | if autoupdate.MaybeRunWindowsUpdateHelper() { |
| 29 | return |
| 30 | } |
| 31 | |
| 32 | console.Init() |
| 33 | |
| 34 | _ = initSentry() |
| 35 | defer sentry.Flush(5 * time.Second) |
| 36 | |
| 37 | // Wrap execution with panic recovery |
| 38 | defer func() { |
| 39 | if r := recover(); r != nil { |
| 40 | sentry.CurrentHub().Recover(r) |
| 41 | sentry.Flush(5 * time.Second) |
| 42 | panic(r) |
| 43 | } |
| 44 | }() |
| 45 | |
| 46 | os.Exit(cmd.Execute()) |
| 47 | } |
| 48 | |
| 49 | func initSentry() error { |
| 50 | // DSN is injected at build time - if empty, Sentry is disabled |
nothing calls this directly
no test coverage detected