mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
Support bound variables (struct literals)
Factor out unaryexpression parsing Fix package bleed between tests
This commit is contained in:
@@ -160,6 +160,10 @@ func (*GreetService) StructPointerInputErrorOutput(in *Person) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (*GreetService) StructInputStructOutput(in Person) Person {
|
||||
return in
|
||||
}
|
||||
|
||||
func (*GreetService) StructPointerInputStructPointerOutput(in *Person) *Person {
|
||||
return in
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
"github.com/wailsapp/wails/v3/pkg/application"
|
||||
"log"
|
||||
)
|
||||
|
||||
// GreetService is great
|
||||
type GreetService struct {
|
||||
SomeVariable int
|
||||
lowerCase string
|
||||
}
|
||||
|
||||
// Greet someone
|
||||
func (*GreetService) Greet(name string) string {
|
||||
return "Hello " + name
|
||||
}
|
||||
|
||||
func main() {
|
||||
greetService := &GreetService{}
|
||||
app := application.New(application.Options{
|
||||
Bind: []interface{}{
|
||||
greetService,
|
||||
},
|
||||
})
|
||||
|
||||
app.NewWebviewWindow()
|
||||
|
||||
err := app.Run()
|
||||
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user