all: clean up code, upgrade to modern Go

Signed-off-by: ddkwork
This commit is contained in:
Admin
2025-05-05 23:27:04 +08:00
committed by Elias Naur
parent 86668e8b45
commit f73287be87
58 changed files with 413 additions and 241 deletions
+3 -4
View File
@@ -4,6 +4,7 @@ package input
import (
"io"
"slices"
"gioui.org/io/clipboard"
"gioui.org/io/event"
@@ -60,10 +61,8 @@ func (q *clipboardQueue) ProcessWriteClipboard(req clipboard.WriteCmd) {
}
func (q *clipboardQueue) ProcessReadClipboard(state clipboardState, tag event.Tag) clipboardState {
for _, k := range state.receivers {
if k == tag {
return state
}
if slices.Contains(state.receivers, tag) {
return state
}
n := len(state.receivers)
state.receivers = append(state.receivers[:n:n], tag)