From 24c2e4a37fc7ca40e367a2ef65715937b137fd38 Mon Sep 17 00:00:00 2001 From: "Benjamin Arntzen (aider)" Date: Thu, 27 Jun 2024 05:52:01 +0100 Subject: [PATCH] App struct and methods moved to app.go. --- app.go | 2 +- main.go | 18 ++---------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/app.go b/app.go index 686e2a7..b1c5c76 100644 --- a/app.go +++ b/app.go @@ -1,4 +1,4 @@ -package main +package app import ( "context" diff --git a/main.go b/main.go index f825ab1..d91a624 100644 --- a/main.go +++ b/main.go @@ -7,24 +7,10 @@ import ( "github.com/wailsapp/wails/v2" "github.com/wailsapp/wails/v2/pkg/options" "github.com/wailsapp/wails/v2/pkg/options/assetserver" - "./app" +// App struct and methods moved to app.go +import "yourproject/app" ) -// App struct -type App struct { - ctx context.Context -} - -// NewApp creates a new App application struct -func NewApp() *App { - return &App{} -} - -// startup is called when the app starts. The context is saved -// so we can call the runtime methods -func (a *App) startup(ctx context.Context) { - a.ctx = ctx -} //go:embed frontend var assets embed.FS