[v2] docs(app-dev): fix inconsistent indentation (#4730)

* [v2] docs(app-dev): fix inconsistent indentation

- several places had mixed indentation (tabs _and_ spaces)
- some lines had incorrect indentation, partially due to the above

* add changelog entry per PR template

---------

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
This commit is contained in:
Anton Gilgur 2025-11-30 01:40:51 -05:00 committed by GitHub
commit e37a7b9d4b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 20 deletions

View file

@ -59,7 +59,6 @@ func main() {
log.Fatal(err)
}
}
```
More information on application lifecycle hooks can be found [here](../howdoesitwork.mdx#application-lifecycle-callbacks).
@ -91,7 +90,7 @@ func (a *App) shutdown(ctx context.Context) {
}
func (a *App) Greet(name string) string {
return fmt.Sprintf("Hello %s!", name)
return fmt.Sprintf("Hello %s!", name)
}
```
@ -108,15 +107,14 @@ func main() {
Height: 600,
OnStartup: app.startup,
OnShutdown: app.shutdown,
Bind: []interface{}{
app,
},
Bind: []interface{}{
app,
},
})
if err != nil {
log.Fatal(err)
}
}
```
This will bind all public methods in our `App` struct (it will never bind the startup and shutdown methods).
@ -142,10 +140,10 @@ func main() {
otherStruct.SetContext(ctx)
},
OnShutdown: app.shutdown,
Bind: []interface{}{
app,
Bind: []interface{}{
app,
otherStruct
},
},
})
if err != nil {
log.Fatal(err)
@ -196,18 +194,17 @@ func main() {
Height: 600,
OnStartup: app.startup,
OnShutdown: app.shutdown,
Bind: []interface{}{
app,
},
EnumBind: []interface{}{
AllWeekdays,
},
Bind: []interface{}{
app,
},
EnumBind: []interface{}{
AllWeekdays,
},
})
if err != nil {
log.Fatal(err)
}
}
```
This will add missing enums to your `model.ts` file.
@ -232,15 +229,14 @@ func main() {
OnStartup: app.startup,
OnShutdown: app.shutdown,
Menu: app.menu(),
Bind: []interface{}{
app,
},
Bind: []interface{}{
app,
},
})
if err != nil {
log.Fatal(err)
}
}
```
## Assets

View file

@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Fixed indentation in Application Development guide by @agilgur5 in [#4730](https://github.com/wailsapp/wails/pull/4730)
- Updated Application Development guide to show imports in the `app.go` snippets by @agilgur5 in [#4731](https://github.com/wailsapp/wails/pull/4731)
- Fixed link to CoC in Community Guide when there was a trailing slash by @agilgur5 in [#4732](https://github.com/wailsapp/wails/pull/4732)
- Fixed indentation in "How does it work?" page by @agilgur5 in [#4733](https://github.com/wailsapp/wails/pull/4733)