From c81a1f9671cf9910b34ac8644c2b185677282f23 Mon Sep 17 00:00:00 2001 From: Egon Elbre Date: Mon, 2 Jan 2023 19:07:05 +0200 Subject: [PATCH] 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 --- widget/editor.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/widget/editor.go b/widget/editor.go index 3c11464d..9cb31bc8 100644 --- a/widget/editor.go +++ b/widget/editor.go @@ -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 } -- 2.38.5