5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-05 17:13:22 +08:00
wails/v3/internal/parser/testdata/enum/main.go
Lea Anthony 2bb25b12ff
Update bindings generator to generate bindings in packages and files.
Remove unused JavaScript files
Update tests.
Update v3 docs
2023-12-22 20:01:42 +11:00

61 lines
914 B
Go

package main
import (
_ "embed"
"log"
"github.com/wailsapp/wails/v3/pkg/application"
)
// Title is a title
type Title string
const (
// Mister is a title
Mister Title = "Mr"
Miss Title = "Miss"
Ms Title = "Ms"
Mrs Title = "Mrs"
Dr Title = "Dr"
)
// GreetService is great
type GreetService struct {
SomeVariable int
lowerCase string
target *Person
}
// Person represents a person
type Person struct {
Title Title
Name string
}
// Greet does XYZ
func (*GreetService) Greet(name string, title Title) string {
return "Hello " + string(title) + " " + name
}
// NewPerson creates a new person
func (*GreetService) NewPerson(name string) *Person {
return &Person{Name: name}
}
func main() {
app := application.New(application.Options{
Bind: []interface{}{
&GreetService{},
},
})
app.NewWebviewWindow()
err := app.Run()
if err != nil {
log.Fatal(err)
}
}