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
+2 -6
View File
@@ -9,6 +9,7 @@ import (
"errors"
"fmt"
"runtime"
"slices"
"strings"
"gioui.org/gpu"
@@ -154,12 +155,7 @@ func (c *Context) EnableVSync(enable bool) {
}
func hasExtension(exts []string, ext string) bool {
for _, e := range exts {
if ext == e {
return true
}
}
return false
return slices.Contains(exts, ext)
}
func createContext(disp _EGLDisplay) (*eglContext, error) {
+1 -1
View File
@@ -186,6 +186,6 @@ func eglWaitClient() bool {
// issue34474KeepAlive calls runtime.KeepAlive as a
// workaround for golang.org/issue/34474.
func issue34474KeepAlive(v interface{}) {
func issue34474KeepAlive(v any) {
runtime.KeepAlive(v)
}