From 8d9639487c7f6da4fafb02813439ebcafdf06326 Mon Sep 17 00:00:00 2001 From: Jan Steinke Date: Thu, 22 Feb 2024 21:38:00 +0200 Subject: [PATCH] linting --- ui/chart.go | 10 +++++----- ui/menu.go | 1 + ui/ui.go | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ui/chart.go b/ui/chart.go index 831aac2..0e7c841 100644 --- a/ui/chart.go +++ b/ui/chart.go @@ -80,22 +80,22 @@ type barChart struct { func (c *barChart) OnMount(ctx app.Context) { ctx.After(50*time.Millisecond, func(ctx app.Context) { - ctx.Defer(func(ctx app.Context) { + ctx.Defer(func(_ app.Context) { c.eChartsInstance = app.Window().Get("echarts"). Call("init", c.JSValue(), c.Bar.Theme) - c.UpdateBarChart(ctx, c.Bar) + c.UpdateBarChart(c.Bar) }) }) ctx.Handle(storage.EventScoreUpdate, c.HandleScoreUpdate) } -func (c *barChart) HandleScoreUpdate(ctx app.Context, a app.Action) { +func (c *barChart) HandleScoreUpdate(_ app.Context, a app.Action) { s, ok := a.Value.(storage.Scores) if !ok { fmt.Println("wrong type") return } - c.UpdateBarChart(ctx, newBarChart(s.Endless)) + c.UpdateBarChart(newBarChart(s.Endless)) } func (c *barChart) OnDismount() { @@ -104,7 +104,7 @@ func (c *barChart) OnDismount() { } } -func (c *barChart) UpdateBarChart(ctx app.Context, config *charts.Bar) { +func (c *barChart) UpdateBarChart(config *charts.Bar) { config.Validate() c.Bar = config diff --git a/ui/menu.go b/ui/menu.go index a44bc0a..d5155db 100644 --- a/ui/menu.go +++ b/ui/menu.go @@ -71,6 +71,7 @@ func (g *menu) storeSpeed(ctx app.Context, _ app.Event) { g.selectedSpeed = s } +// NewGameSettings are the settings of a new game that gets published to the logic type NewGameSettings struct { Speed storage.Speed Difficulty storage.Difficulty diff --git a/ui/ui.go b/ui/ui.go index 022d956..64bdd82 100644 --- a/ui/ui.go +++ b/ui/ui.go @@ -81,7 +81,7 @@ func (u *UI) onUpdateClick(ctx app.Context, _ app.Event) { ctx.Reload() } -func (u *UI) handleStateChange(ctx app.Context, a app.Action) { +func (u *UI) handleStateChange(_ app.Context, a app.Action) { txt, ok := a.Value.(string) if !ok { fmt.Println("wrong type")