Skip to content

Commit c87ae85

Browse files
committed
refactor: switch golang.org/x/exp to standard library packages
1 parent a7d23a7 commit c87ae85

6 files changed

Lines changed: 13 additions & 12 deletions

File tree

arrow/compute/exec/kernel.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ import (
2222
"context"
2323
"fmt"
2424
"hash/maphash"
25+
"slices"
2526
"strings"
2627

2728
"github.com/apache/arrow-go/v18/arrow"
2829
"github.com/apache/arrow-go/v18/arrow/bitutil"
2930
"github.com/apache/arrow-go/v18/arrow/internal/debug"
3031
"github.com/apache/arrow-go/v18/arrow/memory"
31-
"golang.org/x/exp/slices"
3232
)
3333

3434
var hashSeed = maphash.MakeSeed()

arrow/compute/exec/utils.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@
1919
package exec
2020

2121
import (
22+
"cmp"
2223
"fmt"
2324
"math"
25+
"slices"
2426
"sync/atomic"
2527
"unsafe"
2628

2729
"github.com/apache/arrow-go/v18/arrow"
2830
"github.com/apache/arrow-go/v18/arrow/array"
2931
"github.com/apache/arrow-go/v18/arrow/bitutil"
3032
"github.com/apache/arrow-go/v18/arrow/memory"
31-
"golang.org/x/exp/constraints"
32-
"golang.org/x/exp/slices"
3333
)
3434

3535
// GetSpanValues returns a properly typed slice by reinterpreting
@@ -51,14 +51,14 @@ func GetSpanOffsets[T int32 | int64](span *ArraySpan, i int) []T {
5151
return ret[span.Offset:]
5252
}
5353

54-
func Min[T constraints.Ordered](a, b T) T {
54+
func Min[T cmp.Ordered](a, b T) T {
5555
if a < b {
5656
return a
5757
}
5858
return b
5959
}
6060

61-
func Max[T constraints.Ordered](a, b T) T {
61+
func Max[T cmp.Ordered](a, b T) T {
6262
if a > b {
6363
return a
6464
}

arrow/compute/registry.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
package compute
2020

2121
import (
22+
"maps"
23+
"slices"
2224
"sync"
2325

2426
"github.com/apache/arrow-go/v18/arrow/internal/debug"
25-
"golang.org/x/exp/maps"
26-
"golang.org/x/exp/slices"
2727
)
2828

2929
type FunctionRegistry interface {
@@ -138,7 +138,7 @@ func (reg *funcRegistry) GetFunctionNames() (out []string) {
138138
reg.mx.RLock()
139139
defer reg.mx.RUnlock()
140140

141-
out = append(out, maps.Keys(reg.nameToFunction)...)
141+
out = append(out, slices.Collect(maps.Keys(reg.nameToFunction))...)
142142
slices.Sort(out)
143143
return
144144
}

arrow/compute/registry_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ package compute_test
2121
import (
2222
"context"
2323
"errors"
24+
"slices"
2425
"testing"
2526

2627
"github.com/apache/arrow-go/v18/arrow"
2728
"github.com/apache/arrow-go/v18/arrow/compute"
2829
"github.com/apache/arrow-go/v18/arrow/compute/exec"
2930
"github.com/stretchr/testify/assert"
30-
"golang.org/x/exp/slices"
3131
)
3232

3333
var registry compute.FunctionRegistry

arrow/flight/cookie_middleware.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ package flight
1818

1919
import (
2020
"context"
21+
"maps"
2122
"net/http"
2223
"strings"
2324
"sync"
2425
"time"
2526

26-
"golang.org/x/exp/maps"
2727
"google.golang.org/grpc/metadata"
2828
)
2929

internal/utils/math.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,21 @@
1717
package utils
1818

1919
import (
20+
"cmp"
2021
"math"
2122
"math/bits"
2223

2324
"golang.org/x/exp/constraints"
2425
)
2526

26-
func Min[T constraints.Ordered](a, b T) T {
27+
func Min[T cmp.Ordered](a, b T) T {
2728
if a < b {
2829
return a
2930
}
3031
return b
3132
}
3233

33-
func Max[T constraints.Ordered](a, b T) T {
34+
func Max[T cmp.Ordered](a, b T) T {
3435
if a > b {
3536
return a
3637
}

0 commit comments

Comments
 (0)