mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 15:11:53 +08:00

* [v3] add test case for parser (create struct from func) * [v3] add another test case for parser (func in other pkg) + misc
41 lines
573 B
Go
41 lines
573 B
Go
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 NewGreetService() *GreetService {
|
|
return &GreetService{}
|
|
}
|
|
|
|
func main() {
|
|
greetService := NewGreetService()
|
|
app := application.New(application.Options{
|
|
Bind: []interface{}{
|
|
greetService,
|
|
},
|
|
})
|
|
|
|
app.NewWebviewWindow()
|
|
|
|
err := app.Run()
|
|
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
|
|
}
|