diff --git a/v2/internal/app/desktop.go b/v2/internal/app/desktop.go index 2f33ad69d..f152d113e 100644 --- a/v2/internal/app/desktop.go +++ b/v2/internal/app/desktop.go @@ -91,7 +91,7 @@ func (a *App) Run() error { // Start the service bus a.servicebus.Debug() err = a.servicebus.Start() - if err == nil { + if err != nil { return err } @@ -103,7 +103,7 @@ func (a *App) Run() error { } a.runtime = runtimesubsystem err = a.runtime.Start() - if err == nil { + if err != nil { return err } @@ -119,7 +119,7 @@ func (a *App) Run() error { } a.binding = bindingsubsystem err = a.binding.Start() - if err == nil { + if err != nil { return err } @@ -130,7 +130,7 @@ func (a *App) Run() error { } a.log = log err = a.log.Start() - if err == nil { + if err != nil { return err } @@ -141,7 +141,7 @@ func (a *App) Run() error { } a.dispatcher = dispatcher err = dispatcher.Start() - if err == nil { + if err != nil { return err } @@ -152,7 +152,7 @@ func (a *App) Run() error { } a.event = event err = a.event.Start() - if err == nil { + if err != nil { return err } @@ -180,7 +180,7 @@ func (a *App) Run() error { } a.menu = menusubsystem err = a.menu.Start() - if err == nil { + if err != nil { return err } } @@ -194,7 +194,7 @@ func (a *App) Run() error { } a.tray = traysubsystem err = a.tray.Start() - if err == nil { + if err != nil { return err } } @@ -206,7 +206,7 @@ func (a *App) Run() error { } a.call = call err = a.call.Start() - if err == nil { + if err != nil { return err } @@ -219,7 +219,7 @@ func (a *App) Run() error { result := a.window.Run(dispatcher, bindingDump, a.debug) a.logger.Trace("Ffenestri.Run() exited") err = a.servicebus.Stop() - if err == nil { + if err != nil { return err } diff --git a/v2/internal/templates/templates/svelte-mui/basic.tmpl.go b/v2/internal/templates/templates/svelte-mui/basic.tmpl.go index b9b1d419e..da71d2da2 100644 --- a/v2/internal/templates/templates/svelte-mui/basic.tmpl.go +++ b/v2/internal/templates/templates/svelte-mui/basic.tmpl.go @@ -3,7 +3,7 @@ package main import ( "fmt" - wails "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2" ) // Basic application struct diff --git a/v2/internal/templates/templates/svelte-mui/main.tmpl.go b/v2/internal/templates/templates/svelte-mui/main.tmpl.go index 5656d03e3..efceec4d3 100644 --- a/v2/internal/templates/templates/svelte-mui/main.tmpl.go +++ b/v2/internal/templates/templates/svelte-mui/main.tmpl.go @@ -1,15 +1,22 @@ package main import ( - wails "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2" + "log" ) func main() { // Create application with options - app := wails.CreateApp("{{.ProjectName}}", 1024, 768) + app, err := wails.CreateApp("{{.ProjectName}}", 1024, 768) + if err != nil { + log.Fatal(err) + } app.Bind(newBasic()) - app.Run() + err = app.Run() + if err != nil { + log.Fatal(err) + } } diff --git a/v2/internal/templates/templates/vanilla/basic.tmpl.go b/v2/internal/templates/templates/vanilla/basic.tmpl.go index b9b1d419e..da71d2da2 100644 --- a/v2/internal/templates/templates/vanilla/basic.tmpl.go +++ b/v2/internal/templates/templates/vanilla/basic.tmpl.go @@ -3,7 +3,7 @@ package main import ( "fmt" - wails "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2" ) // Basic application struct diff --git a/v2/internal/templates/templates/vanilla/main.tmpl.go b/v2/internal/templates/templates/vanilla/main.tmpl.go index 5656d03e3..1dc265250 100644 --- a/v2/internal/templates/templates/vanilla/main.tmpl.go +++ b/v2/internal/templates/templates/vanilla/main.tmpl.go @@ -1,7 +1,7 @@ package main import ( - wails "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2" ) func main() { diff --git a/v2/internal/templates/templates/vuetify2-basic/basic.tmpl.go b/v2/internal/templates/templates/vuetify2-basic/basic.tmpl.go index b9b1d419e..da71d2da2 100644 --- a/v2/internal/templates/templates/vuetify2-basic/basic.tmpl.go +++ b/v2/internal/templates/templates/vuetify2-basic/basic.tmpl.go @@ -3,7 +3,7 @@ package main import ( "fmt" - wails "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2" ) // Basic application struct diff --git a/v2/internal/templates/templates/vuetify2-basic/main.tmpl.go b/v2/internal/templates/templates/vuetify2-basic/main.tmpl.go index 5656d03e3..1dc265250 100644 --- a/v2/internal/templates/templates/vuetify2-basic/main.tmpl.go +++ b/v2/internal/templates/templates/vuetify2-basic/main.tmpl.go @@ -1,7 +1,7 @@ package main import ( - wails "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2" ) func main() { diff --git a/v2/pkg/commands/build/server.go b/v2/pkg/commands/build/server.go index 12a0ae2d2..2047e74d3 100644 --- a/v2/pkg/commands/build/server.go +++ b/v2/pkg/commands/build/server.go @@ -56,11 +56,11 @@ func (s *ServerBuilder) BuildBaseAssets(assets *html.AssetBundle) error { // Fetch, update, and reinject index.html index, err := db.Read("index.html") if err != nil { - return fmt.Errorf(`Failed to locate "index.html"`) + return fmt.Errorf(`failed to locate "index.html"`) } splits := strings.Split(string(index), "") if len(splits) != 2 { - return fmt.Errorf("Unable to locate a tag in your frontend/index.html") + return fmt.Errorf("unable to locate a tag in your frontend/index.html") } injectScript := `` result := []string{} diff --git a/v2/pkg/parser/testproject/basic.go b/v2/pkg/parser/testproject/basic.go index 4d9ad10de..cce57e18f 100644 --- a/v2/pkg/parser/testproject/basic.go +++ b/v2/pkg/parser/testproject/basic.go @@ -5,7 +5,7 @@ import ( "testproject/mypackage" - wails "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2" ) // Basic application struct @@ -56,11 +56,11 @@ func (b *Basic) Greet(name string) string { } // MultipleGreets returns greetings for the given name -func (b *Basic) MultipleGreets(name string) []string { +func (b *Basic) MultipleGreets(_ string) []string { return []string{"hi", "hello", "croeso!"} } // RemovePerson Removes the given person -func (b *Basic) RemovePerson(p *mypackage.Person) { +func (b *Basic) RemovePerson(_ *mypackage.Person) { // dummy } diff --git a/v2/test/disable-resize/basic.go b/v2/test/disable-resize/basic.go index 69de872be..d9669734a 100644 --- a/v2/test/disable-resize/basic.go +++ b/v2/test/disable-resize/basic.go @@ -3,7 +3,7 @@ package main import ( "fmt" - wails "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2" ) // Basic application struct diff --git a/v2/test/disable-resize/main.go b/v2/test/disable-resize/main.go index e04d13691..83fb066cb 100644 --- a/v2/test/disable-resize/main.go +++ b/v2/test/disable-resize/main.go @@ -1,7 +1,7 @@ package main import ( - wails "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2" "github.com/wailsapp/wails/v2/pkg/options" ) diff --git a/v2/test/frameless/basic.go b/v2/test/frameless/basic.go index 2026f9763..5fa5e5671 100644 --- a/v2/test/frameless/basic.go +++ b/v2/test/frameless/basic.go @@ -1,9 +1,10 @@ package main +//goland:noinspection GoRedundantImportAlias import ( "fmt" - wails "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2" ) // Basic application struct diff --git a/v2/test/frameless/main.go b/v2/test/frameless/main.go index 9cd09c39d..dc0da6b14 100644 --- a/v2/test/frameless/main.go +++ b/v2/test/frameless/main.go @@ -1,7 +1,7 @@ package main import ( - wails "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2" "github.com/wailsapp/wails/v2/pkg/options" "github.com/wailsapp/wails/v2/pkg/options/mac" ) diff --git a/v2/test/hidden/basic.go b/v2/test/hidden/basic.go index f763cba8e..a51927ed0 100644 --- a/v2/test/hidden/basic.go +++ b/v2/test/hidden/basic.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - wails "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2" ) // Basic application struct diff --git a/v2/test/hidden/main.go b/v2/test/hidden/main.go index aa6e4218f..fe375c1c3 100644 --- a/v2/test/hidden/main.go +++ b/v2/test/hidden/main.go @@ -1,7 +1,7 @@ package main import ( - wails "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2" "github.com/wailsapp/wails/v2/pkg/options" ) diff --git a/v2/test/kitchensink/browser.go b/v2/test/kitchensink/browser.go index a1623335d..00da4c29a 100644 --- a/v2/test/kitchensink/browser.go +++ b/v2/test/kitchensink/browser.go @@ -1,7 +1,7 @@ package main import ( - wails "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2" ) // Browser struct diff --git a/v2/test/kitchensink/dialog.go b/v2/test/kitchensink/dialog.go index 0e0a667c8..7eb3a2351 100644 --- a/v2/test/kitchensink/dialog.go +++ b/v2/test/kitchensink/dialog.go @@ -1,7 +1,7 @@ package main import ( - wails "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2" "github.com/wailsapp/wails/v2/pkg/options" ) diff --git a/v2/test/kitchensink/events.go b/v2/test/kitchensink/events.go index bb4f50173..6eb34078f 100644 --- a/v2/test/kitchensink/events.go +++ b/v2/test/kitchensink/events.go @@ -1,7 +1,7 @@ package main import ( - wails "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2" ) // Events struct diff --git a/v2/test/kitchensink/frontend/src/pages/Dialog/Open/code.go b/v2/test/kitchensink/frontend/src/pages/Dialog/Open/code.go index 6829bb922..b8a4e56ba 100644 --- a/v2/test/kitchensink/frontend/src/pages/Dialog/Open/code.go +++ b/v2/test/kitchensink/frontend/src/pages/Dialog/Open/code.go @@ -3,7 +3,7 @@ package main import ( "io/ioutil" - wails "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2" "github.com/wailsapp/wails/v2/pkg/options" ) diff --git a/v2/test/kitchensink/frontend/src/pages/Dialog/Save/code.go b/v2/test/kitchensink/frontend/src/pages/Dialog/Save/code.go index 8a55a5602..1655ca8e9 100644 --- a/v2/test/kitchensink/frontend/src/pages/Dialog/Save/code.go +++ b/v2/test/kitchensink/frontend/src/pages/Dialog/Save/code.go @@ -3,7 +3,7 @@ package main import ( "io/ioutil" - wails "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2" "github.com/wailsapp/wails/v2/pkg/options" ) diff --git a/v2/test/kitchensink/frontend/src/pages/System/Platform/code.go b/v2/test/kitchensink/frontend/src/pages/System/Platform/code.go index 89c8158cc..6b49f008d 100644 --- a/v2/test/kitchensink/frontend/src/pages/System/Platform/code.go +++ b/v2/test/kitchensink/frontend/src/pages/System/Platform/code.go @@ -1,7 +1,7 @@ package main import ( - wails "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2" ) type MyStruct struct { diff --git a/v2/test/kitchensink/frontend/src/pages/Window/Window/code.go b/v2/test/kitchensink/frontend/src/pages/Window/Window/code.go index e7b93fa3a..eda921e18 100644 --- a/v2/test/kitchensink/frontend/src/pages/Window/Window/code.go +++ b/v2/test/kitchensink/frontend/src/pages/Window/Window/code.go @@ -4,7 +4,7 @@ import ( "image" "os" - wails "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2" "github.com/wailsapp/wails/v2/internal/runtime" ) diff --git a/v2/test/kitchensink/frontend/src/pages/browser/Browser/code.go b/v2/test/kitchensink/frontend/src/pages/browser/Browser/code.go index 055ed2ef5..b7e8e36f6 100644 --- a/v2/test/kitchensink/frontend/src/pages/browser/Browser/code.go +++ b/v2/test/kitchensink/frontend/src/pages/browser/Browser/code.go @@ -1,6 +1,6 @@ package main -import wails "github.com/wailsapp/wails/v2" +import "github.com/wailsapp/wails/v2" type MyStruct struct { runtime *wails.Runtime diff --git a/v2/test/kitchensink/frontend/src/pages/events/Emit/code.go b/v2/test/kitchensink/frontend/src/pages/events/Emit/code.go index faf7f9cc3..04c9f2d23 100644 --- a/v2/test/kitchensink/frontend/src/pages/events/Emit/code.go +++ b/v2/test/kitchensink/frontend/src/pages/events/Emit/code.go @@ -3,7 +3,7 @@ package main import ( "io/ioutil" - wails "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2" ) type MyStruct struct { diff --git a/v2/test/kitchensink/frontend/src/pages/events/On/code.go b/v2/test/kitchensink/frontend/src/pages/events/On/code.go index 44a6d657e..8a1508603 100644 --- a/v2/test/kitchensink/frontend/src/pages/events/On/code.go +++ b/v2/test/kitchensink/frontend/src/pages/events/On/code.go @@ -3,7 +3,7 @@ package main import ( "fmt" - wails "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2" ) type MyStruct struct { diff --git a/v2/test/kitchensink/frontend/src/pages/events/OnMultiple/code.go b/v2/test/kitchensink/frontend/src/pages/events/OnMultiple/code.go index e34cad17f..996a5923c 100644 --- a/v2/test/kitchensink/frontend/src/pages/events/OnMultiple/code.go +++ b/v2/test/kitchensink/frontend/src/pages/events/OnMultiple/code.go @@ -1,6 +1,6 @@ package main -import wails "github.com/wailsapp/wails/v2" +import "github.com/wailsapp/wails/v2" type MyStruct struct { runtime *wails.Runtime diff --git a/v2/test/kitchensink/frontend/src/pages/events/Once/code.go b/v2/test/kitchensink/frontend/src/pages/events/Once/code.go index d4972985a..8de0956cb 100644 --- a/v2/test/kitchensink/frontend/src/pages/events/Once/code.go +++ b/v2/test/kitchensink/frontend/src/pages/events/Once/code.go @@ -1,6 +1,6 @@ package main -import wails "github.com/wailsapp/wails/v2" +import "github.com/wailsapp/wails/v2" type MyStruct struct { runtime *wails.Runtime diff --git a/v2/test/kitchensink/frontend/src/pages/logging/Log/code.go b/v2/test/kitchensink/frontend/src/pages/logging/Log/code.go index c2fce47de..25bbb5334 100644 --- a/v2/test/kitchensink/frontend/src/pages/logging/Log/code.go +++ b/v2/test/kitchensink/frontend/src/pages/logging/Log/code.go @@ -1,6 +1,6 @@ package main -import wails "github.com/wailsapp/wails/v2" +import "github.com/wailsapp/wails/v2" type MyStruct struct { runtime *wails.Runtime diff --git a/v2/test/kitchensink/frontend/src/pages/logging/SetLogLevel/code.go b/v2/test/kitchensink/frontend/src/pages/logging/SetLogLevel/code.go index 570283361..f65c72e7b 100644 --- a/v2/test/kitchensink/frontend/src/pages/logging/SetLogLevel/code.go +++ b/v2/test/kitchensink/frontend/src/pages/logging/SetLogLevel/code.go @@ -1,7 +1,7 @@ package main import ( - wails "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2" "github.com/wailsapp/wails/v2/pkg/logger" ) diff --git a/v2/test/kitchensink/logger.go b/v2/test/kitchensink/logger.go index e4aead3ea..a3cc6e519 100644 --- a/v2/test/kitchensink/logger.go +++ b/v2/test/kitchensink/logger.go @@ -1,7 +1,7 @@ package main import ( - wails "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2" "github.com/wailsapp/wails/v2/pkg/logger" ) diff --git a/v2/test/kitchensink/main.go b/v2/test/kitchensink/main.go index 299dcf9cc..ff879bcdf 100644 --- a/v2/test/kitchensink/main.go +++ b/v2/test/kitchensink/main.go @@ -11,7 +11,7 @@ import ( func main() { // Create application with options - app := wails.CreateAppWithOptions(&options.App{ + app, err := wails.CreateAppWithOptions(&options.App{ Title: "Kitchen Sink", Width: 1024, Height: 768, @@ -28,6 +28,10 @@ func main() { LogLevel: logger.TRACE, }) + if err != nil { + log.Fatal(err) + } + app.Bind(&Events{}) app.Bind(&Logger{}) app.Bind(&Browser{}) @@ -36,7 +40,7 @@ func main() { app.Bind(&Window{}) app.Bind(&Menu{}) - err := app.Run() + err = app.Run() if err != nil { log.Fatal(err) } diff --git a/v2/test/kitchensink/system.go b/v2/test/kitchensink/system.go index 34bef8ca0..6efccb99f 100644 --- a/v2/test/kitchensink/system.go +++ b/v2/test/kitchensink/system.go @@ -1,7 +1,7 @@ package main import ( - wails "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2" ) // System struct diff --git a/v2/test/kitchensink/window.go b/v2/test/kitchensink/window.go index f3de20d8b..e1cee3f81 100644 --- a/v2/test/kitchensink/window.go +++ b/v2/test/kitchensink/window.go @@ -1,7 +1,7 @@ package main import ( - wails "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2" ) // Window struct diff --git a/v2/test/minmax/basic.go b/v2/test/minmax/basic.go index 69de872be..d9669734a 100644 --- a/v2/test/minmax/basic.go +++ b/v2/test/minmax/basic.go @@ -3,7 +3,7 @@ package main import ( "fmt" - wails "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2" ) // Basic application struct diff --git a/v2/test/minmax/main.go b/v2/test/minmax/main.go index 0bdadf0a7..419018ca2 100644 --- a/v2/test/minmax/main.go +++ b/v2/test/minmax/main.go @@ -1,7 +1,7 @@ package main import ( - wails "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2" "github.com/wailsapp/wails/v2/pkg/options" ) diff --git a/v2/test/runtime/calc.go b/v2/test/runtime/calc.go index 2767b1d78..f7e2f5709 100644 --- a/v2/test/runtime/calc.go +++ b/v2/test/runtime/calc.go @@ -3,7 +3,7 @@ package main import ( "fmt" - wails "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2" ) // Calc is a calculator diff --git a/v2/test/runtime/main.go b/v2/test/runtime/main.go index 2b110a5e1..c2f114831 100644 --- a/v2/test/runtime/main.go +++ b/v2/test/runtime/main.go @@ -1,7 +1,7 @@ package main import ( - wails "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2" "github.com/wailsapp/wails/v2/pkg/options" "github.com/wailsapp/wails/v2/pkg/options/mac" ) diff --git a/v2/test/runtime/runtime.go b/v2/test/runtime/runtime.go index 632937332..bba806876 100644 --- a/v2/test/runtime/runtime.go +++ b/v2/test/runtime/runtime.go @@ -3,7 +3,7 @@ package main import ( "time" - wails "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2" "github.com/wailsapp/wails/v2/pkg/options" ) diff --git a/v2/wails.go b/v2/wails.go index 4a8937a0e..4c395dec8 100644 --- a/v2/wails.go +++ b/v2/wails.go @@ -12,12 +12,12 @@ import ( type Runtime = runtime.Runtime // CreateAppWithOptions creates an application based on the given config -func CreateAppWithOptions(options *options.App) *app.App { +func CreateAppWithOptions(options *options.App) (*app.App, error) { return app.CreateApp(options) } // CreateApp creates an application based on the given title, width and height -func CreateApp(title string, width int, height int) *app.App { +func CreateApp(title string, width int, height int) (*app.App, error) { options := &options.App{ Title: title,