Files
Ilia Denisov a7793f5416 ui calculator
2026-03-30 19:38:24 +02:00

52 lines
932 B
Go

package main
import (
"context"
"errors"
"fmt"
"galaxy/client"
"galaxy/client/appmeta"
"galaxy/connector/http"
"galaxy/storage/fs"
"os"
"os/signal"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/lang"
)
func main() {
var err error
defer func() {
if err == nil {
if r := recover(); r != nil {
err = errors.Join(err, fmt.Errorf("panic: %v", r))
}
}
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}()
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt)
defer cancel()
app := app.NewWithID(appmeta.AppID)
if err = lang.AddTranslationsFS(client.Translations, "resource/lang"); err != nil {
return
}
s, err := fs.NewFS(app.Storage().RootURI().Path())
if err != nil {
return
}
conn, err := http.NewHttpConnector(ctx, appmeta.DefaultBackendURL)
if err != nil {
return
}
c, err := client.NewClient(s, conn, app)
if err != nil {
return
}
err = c.Run()
}