diff options
| author | Ophestra Umiker <cat@ophivana.moe> | 2024-10-20 00:07:48 +0900 |
|---|---|---|
| committer | Ophestra Umiker <cat@ophivana.moe> | 2024-10-20 00:22:18 +0900 |
| commit | ad0034b09aaa76aca478304518c1394ba292a619 (patch) | |
| tree | 07fc40ae14d9eecb368997688c0de1eb1e89cb15 /main.go | |
| parent | 1da845d78bdd6be03e771958100d388b3e6e9fcc (diff) | |
app: move app ID to app struct
App ID is inherent to App, and it makes no sense to generate it as part of the app sealing process.
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -54,8 +54,10 @@ func main() { // invoke app r := 1 - a := app.New() - if err := a.Seal(loadConfig()); err != nil { + a, err := app.New() + if err != nil { + fatalf("cannot create app: %s\n", err) + } else if err = a.Seal(loadConfig()); err != nil { logBaseError(err, "fortify: cannot seal app:") } else if err = a.Start(); err != nil { logBaseError(err, "fortify: cannot start app:") @@ -65,7 +67,7 @@ func main() { } logWaitError(err) } - if err := a.WaitErr(); err != nil { + if err = a.WaitErr(); err != nil { fmt.Println("fortify: inner wait failed:", err) } os.Exit(r) |
