widget: fix build for go1.17

go.mod specifies 1.18, due to go.mod behavior and to avoid some issues
with updating the dependencies. However, we can still support older go
version, as long as it compiles with the older version.

Signed-off-by: Egon Elbre <egonelbre@gmail.com>
This commit is contained in:
Egon Elbre
2023-01-02 19:07:05 +02:00
committed by Elias Naur
parent e9bce02b24
commit c81a1f9671
+2 -4
View File
@@ -24,8 +24,6 @@ import (
"gioui.org/op/clip"
"gioui.org/text"
"gioui.org/unit"
"golang.org/x/exp/constraints"
)
// Editor implements an editable and scrollable text area.
@@ -997,14 +995,14 @@ func max(a, b int) int {
return b
}
func min[T constraints.Ordered](a, b T) T {
func min(a, b int) int {
if a < b {
return a
}
return b
}
func abs[T constraints.Signed](n T) T {
func abs(n int) int {
if n < 0 {
return -n
}