Skip to content

Commit

Permalink
chore: replace golang.org/x/exp with stdlib (#1931)
Browse files Browse the repository at this point in the history
Signed-off-by: Eng Zer Jun <[email protected]>
  • Loading branch information
Juneezee authored Jan 27, 2025
1 parent c380935 commit f9881a6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ require (
github.com/spf13/cobra v1.8.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/x448/float16 v0.8.4 // indirect
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56
golang.org/x/net v0.33.0 // indirect
golang.org/x/oauth2 v0.23.0 // indirect
golang.org/x/sys v0.28.0 // indirect
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,6 @@ go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8=
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
Expand Down
4 changes: 2 additions & 2 deletions pkg/utils/nodepool/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ package nodepool_test

import (
"context"
"math/rand/v2"
"testing"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/samber/lo"
"golang.org/x/exp/rand"

"sigs.k8s.io/karpenter/pkg/apis"
v1 "sigs.k8s.io/karpenter/pkg/apis/v1"
Expand Down Expand Up @@ -64,7 +64,7 @@ var _ = Describe("NodePoolUtils", func() {
nps := lo.Shuffle(lo.Times(10, func(_ int) *v1.NodePool {
return test.NodePool(v1.NodePool{
Spec: v1.NodePoolSpec{
Weight: lo.ToPtr[int32](int32(rand.Intn(100) + 1)), //nolint:gosec
Weight: lo.ToPtr[int32](int32(rand.IntN(100) + 1)), //nolint:gosec
},
})
}))
Expand Down
6 changes: 3 additions & 3 deletions pkg/utils/pretty/pretty.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ package pretty

import (
"bytes"
"cmp"
"encoding/json"
"fmt"
"regexp"
"slices"
"strings"
"unicode"

"golang.org/x/exp/constraints"
"golang.org/x/exp/slices"
v1 "k8s.io/api/core/v1"
)

Expand Down Expand Up @@ -55,7 +55,7 @@ func Slice[T any](s []T, maxItems int) string {

// Map truncates a map after a certain number of max items to ensure that the
// description in a log doesn't get too long
func Map[K constraints.Ordered, V any](values map[K]V, maxItems int) string {
func Map[K cmp.Ordered, V any](values map[K]V, maxItems int) string {
var buf bytes.Buffer
count := 0
var keys []K
Expand Down

0 comments on commit f9881a6

Please sign in to comment.