diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-03-18 00:03:27 +0300 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-03-18 00:03:27 +0300 |
commit | b80853de90b10171155b8f3fde47d64ec7bfa0dd (patch) | |
tree | 435d3dbf7a495a0c6ce64c9769e037179aa0d27b /common/math | |
parent | 423594e03a906ef4150f433666ff588b022c3c92 (diff) |
all: gofmt -w -r 'interface{} -> any' .
Updates #9687
Diffstat (limited to 'common/math')
-rw-r--r-- | common/math/math.go | 2 | ||||
-rw-r--r-- | common/math/math_test.go | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/common/math/math.go b/common/math/math.go index cd06379aa..d4e2c1148 100644 --- a/common/math/math.go +++ b/common/math/math.go @@ -20,7 +20,7 @@ import ( // DoArithmetic performs arithmetic operations (+,-,*,/) using reflection to // determine the type of the two terms. -func DoArithmetic(a, b interface{}, op rune) (interface{}, error) { +func DoArithmetic(a, b any, op rune) (any, error) { av := reflect.ValueOf(a) bv := reflect.ValueOf(b) var ai, bi int64 diff --git a/common/math/math_test.go b/common/math/math_test.go index a11701862..89e391ce0 100644 --- a/common/math/math_test.go +++ b/common/math/math_test.go @@ -24,10 +24,10 @@ func TestDoArithmetic(t *testing.T) { c := qt.New(t) for _, test := range []struct { - a interface{} - b interface{} + a any + b any op rune - expect interface{} + expect any }{ {3, 2, '+', int64(5)}, {3, 2, '-', int64(1)}, |