Fix Go lint findings
- commit
- e79a59889947d9ce743d79a99794d262e22adac3
- author
- brice · · 2026-05-11 17:26 UTC
- parent
- 6b42329
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
2 files · +3 -2
M internal/infrastructure/cef/webview_viewport.go +0 -1
| @@ -124,7 +124,6 @@ func (wv *WebView) scheduleResizeRepaintPulse(ctx context.Context, reason string | |||
| 124 | 124 | } | |
| 125 | 125 | seq := wv.viewportResizePulseSeq.Add(1) | |
| 126 | 126 | for _, delayMs := range [...]int64{16, 48} { | |
| 127 | - | delayMs := delayMs | |
| 128 | 127 | task := cefNewTask(cefTaskFunc(func() { | |
| 129 | 128 | if wv == nil || wv.destroyed.Load() || wv.viewportResizePulseSeq.Load() != seq { | |
| 130 | 129 | return | |
| @@ -124,7 +124,6 @@ func (wv *WebView) scheduleResizeRepaintPulse(ctx context.Context, reason string | |||||
| 124 | } | 124 | } | ||
| 125 | seq := wv.viewportResizePulseSeq.Add(1) | 125 | seq := wv.viewportResizePulseSeq.Add(1) | ||
| 126 | for _, delayMs := range [...]int64{16, 48} { | 126 | for _, delayMs := range [...]int64{16, 48} { | ||
| 127 | - | delayMs := delayMs | |||
| 128 | task := cefNewTask(cefTaskFunc(func() { | 127 | task := cefNewTask(cefTaskFunc(func() { | ||
| 129 | if wv == nil || wv.destroyed.Load() || wv.viewportResizePulseSeq.Load() != seq { | 128 | if wv == nil || wv.destroyed.Load() || wv.viewportResizePulseSeq.Load() != seq { | ||
| 130 | return | 129 | return | ||
M internal/ui/coordinator/content/lifecycle_test.go +3 -1
| @@ -259,6 +259,8 @@ func TestLifecycle_RegisterPopupWebView_IgnoresNil(t *testing.T) { | |||
| 259 | 259 | assert.Nil(t, c.GetWebView("popup-1")) | |
| 260 | 260 | } | |
| 261 | 261 | ||
| 262 | + | type syncViewportContextKey struct{} | |
| 263 | + | ||
| 262 | 264 | type syncViewportCapableStub struct { | |
| 263 | 265 | port.WebView | |
| 264 | 266 | called bool | |
| @@ -280,7 +282,7 @@ func TestLifecycle_SyncWebViewViewport_DelegatesWhenCapabilityPresent(t *testing | |||
| 280 | 282 | c := newMinimalCoordinator() | |
| 281 | 283 | c.webViews[entity.PaneID("pane-1")] = wv | |
| 282 | 284 | ||
| 283 | - | ctx := context.WithValue(context.Background(), struct{}{}, "marker") | |
| 285 | + | ctx := context.WithValue(context.Background(), syncViewportContextKey{}, "marker") | |
| 284 | 286 | c.SyncWebViewViewport(ctx, "pane-1", "unit-test") | |
| 285 | 287 | ||
| 286 | 288 | require.True(t, wv.called) | |
| @@ -259,6 +259,8 @@ func TestLifecycle_RegisterPopupWebView_IgnoresNil(t *testing.T) { | |||||
| 259 | assert.Nil(t, c.GetWebView("popup-1")) | 259 | assert.Nil(t, c.GetWebView("popup-1")) | ||
| 260 | } | 260 | } | ||
| 261 | 261 | ||||
| 262 | + | type syncViewportContextKey struct{} | |||
| 263 | + | ||||
| 262 | type syncViewportCapableStub struct { | 264 | type syncViewportCapableStub struct { | ||
| 263 | port.WebView | 265 | port.WebView | ||
| 264 | called bool | 266 | called bool | ||
| @@ -280,7 +282,7 @@ func TestLifecycle_SyncWebViewViewport_DelegatesWhenCapabilityPresent(t *testing | |||||
| 280 | c := newMinimalCoordinator() | 282 | c := newMinimalCoordinator() | ||
| 281 | c.webViews[entity.PaneID("pane-1")] = wv | 283 | c.webViews[entity.PaneID("pane-1")] = wv | ||
| 282 | 284 | ||||
| 283 | - | ctx := context.WithValue(context.Background(), struct{}{}, "marker") | 285 | + | ctx := context.WithValue(context.Background(), syncViewportContextKey{}, "marker") |
| 284 | c.SyncWebViewViewport(ctx, "pane-1", "unit-test") | 286 | c.SyncWebViewViewport(ctx, "pane-1", "unit-test") | ||
| 285 | 287 | ||||
| 286 | require.True(t, wv.called) | 288 | require.True(t, wv.called) | ||