From 3d6cafa94d7f20fc0d9027be0ceb73b4fc64f1e3 Mon Sep 17 00:00:00 2001 From: Egon Elbre Date: Tue, 17 Feb 2026 21:36:58 +0200 Subject: [PATCH] all: run go fix Signed-off-by: Egon Elbre --- app/datadir.go | 1 - app/gl_ios.go | 1 - app/gl_macos.go | 1 - app/ime_test.go | 1 - app/log_ios.go | 1 - app/metal_ios.go | 1 - app/os_ios.go | 1 - app/os_unix.go | 1 - app/runmain.go | 1 - app/vulkan_android.go | 1 - gpu/headless/headless_egl.go | 1 - internal/debug/debug.go | 2 +- internal/gl/types.go | 1 - internal/stroke/stroke_test.go | 1 - io/key/mod.go | 1 - layout/alloc_test.go | 1 - widget/text.go | 10 ++-------- 17 files changed, 3 insertions(+), 24 deletions(-) diff --git a/app/datadir.go b/app/datadir.go index 500a59ab..205f5183 100644 --- a/app/datadir.go +++ b/app/datadir.go @@ -1,7 +1,6 @@ // SPDX-License-Identifier: Unlicense OR MIT //go:build !android -// +build !android package app diff --git a/app/gl_ios.go b/app/gl_ios.go index 2dc2dbfd..31db2541 100644 --- a/app/gl_ios.go +++ b/app/gl_ios.go @@ -1,7 +1,6 @@ // SPDX-License-Identifier: Unlicense OR MIT //go:build darwin && ios && nometal -// +build darwin,ios,nometal package app diff --git a/app/gl_macos.go b/app/gl_macos.go index 2535d9bf..041bcb32 100644 --- a/app/gl_macos.go +++ b/app/gl_macos.go @@ -1,7 +1,6 @@ // SPDX-License-Identifier: Unlicense OR MIT //go:build darwin && !ios && nometal -// +build darwin,!ios,nometal package app diff --git a/app/ime_test.go b/app/ime_test.go index 87a3a434..a15dfbd6 100644 --- a/app/ime_test.go +++ b/app/ime_test.go @@ -1,7 +1,6 @@ // SPDX-License-Identifier: Unlicense OR MIT //go:build go1.18 -// +build go1.18 package app diff --git a/app/log_ios.go b/app/log_ios.go index 82c0f1fe..d67efc7b 100644 --- a/app/log_ios.go +++ b/app/log_ios.go @@ -1,7 +1,6 @@ // SPDX-License-Identifier: Unlicense OR MIT //go:build darwin && ios -// +build darwin,ios package app diff --git a/app/metal_ios.go b/app/metal_ios.go index d5b5dc41..8ea88cf5 100644 --- a/app/metal_ios.go +++ b/app/metal_ios.go @@ -1,7 +1,6 @@ // SPDX-License-Identifier: Unlicense OR MIT //go:build !nometal -// +build !nometal package app diff --git a/app/os_ios.go b/app/os_ios.go index 50d21a44..73765792 100644 --- a/app/os_ios.go +++ b/app/os_ios.go @@ -1,7 +1,6 @@ // SPDX-License-Identifier: Unlicense OR MIT //go:build darwin && ios -// +build darwin,ios package app diff --git a/app/os_unix.go b/app/os_unix.go index 28181b8f..b5a785d0 100644 --- a/app/os_unix.go +++ b/app/os_unix.go @@ -1,7 +1,6 @@ // SPDX-License-Identifier: Unlicense OR MIT //go:build (linux && !android) || freebsd || openbsd -// +build linux,!android freebsd openbsd package app diff --git a/app/runmain.go b/app/runmain.go index d01d85a6..5796c4ab 100644 --- a/app/runmain.go +++ b/app/runmain.go @@ -1,7 +1,6 @@ // SPDX-License-Identifier: Unlicense OR MIT //go:build android || (darwin && ios) -// +build android darwin,ios package app diff --git a/app/vulkan_android.go b/app/vulkan_android.go index 3758d048..e48f71d8 100644 --- a/app/vulkan_android.go +++ b/app/vulkan_android.go @@ -1,7 +1,6 @@ // SPDX-License-Identifier: Unlicense OR MIT //go:build !novulkan -// +build !novulkan package app diff --git a/gpu/headless/headless_egl.go b/gpu/headless/headless_egl.go index 035ba264..662d8174 100644 --- a/gpu/headless/headless_egl.go +++ b/gpu/headless/headless_egl.go @@ -1,7 +1,6 @@ // SPDX-License-Identifier: Unlicense OR MIT //go:build linux || freebsd || openbsd -// +build linux freebsd openbsd package headless diff --git a/internal/debug/debug.go b/internal/debug/debug.go index f6939332..95cbde75 100644 --- a/internal/debug/debug.go +++ b/internal/debug/debug.go @@ -34,7 +34,7 @@ func Parse() { } print := false silent := false - for _, part := range strings.Split(val, ",") { + for part := range strings.SplitSeq(val, ",") { switch part { case textSubsystem: Text.Store(true) diff --git a/internal/gl/types.go b/internal/gl/types.go index dd24963c..491a832b 100644 --- a/internal/gl/types.go +++ b/internal/gl/types.go @@ -1,5 +1,4 @@ //go:build !js -// +build !js package gl diff --git a/internal/stroke/stroke_test.go b/internal/stroke/stroke_test.go index f43fb740..ecb169a0 100644 --- a/internal/stroke/stroke_test.go +++ b/internal/stroke/stroke_test.go @@ -152,7 +152,6 @@ func BenchmarkSplitCubic(b *testing.B) { } for _, s := range scenarios { - s := s b.Run(strconv.Itoa(s.segments), func(b *testing.B) { from, ctrl0, ctrl1, to := s.from, s.ctrl0, s.ctrl1, s.to quads := make([]QuadSegment, s.segments) diff --git a/io/key/mod.go b/io/key/mod.go index 3cf7c2d3..d9bb836f 100644 --- a/io/key/mod.go +++ b/io/key/mod.go @@ -1,7 +1,6 @@ // SPDX-License-Identifier: Unlicense OR MIT //go:build !darwin -// +build !darwin package key diff --git a/layout/alloc_test.go b/layout/alloc_test.go index 59f9c907..0fe1db09 100644 --- a/layout/alloc_test.go +++ b/layout/alloc_test.go @@ -1,7 +1,6 @@ // SPDX-License-Identifier: Unlicense OR MIT //go:build !race -// +build !race package layout diff --git a/widget/text.go b/widget/text.go index eaf7ecae..6dd090da 100644 --- a/widget/text.go +++ b/widget/text.go @@ -362,10 +362,7 @@ func (e *textView) PaintText(gtx layout.Context, material op.CallOp) { // caretWidth returns the width occupied by the caret for the current // gtx. func (e *textView) caretWidth(gtx layout.Context) int { - carWidth2 := gtx.Dp(1) / 2 - if carWidth2 < 1 { - carWidth2 = 1 - } + carWidth2 := max(gtx.Dp(1)/2, 1) return carWidth2 } @@ -434,10 +431,7 @@ func (e *textView) ScrollBounds() image.Rectangle { if e.SingleLine { if len(e.index.lines) > 0 { line := e.index.lines[0] - b.Min.X = line.xOff.Floor() - if b.Min.X > 0 { - b.Min.X = 0 - } + b.Min.X = min(line.xOff.Floor(), 0) } b.Max.X = e.dims.Size.X + b.Min.X - e.viewSize.X } else {