refactor: replace golang.org/x/exp/slices with slices (#16772)

The experimental functions in `golang.org/x/exp/slices` are now
available in the standard library since Go 1.21.

Reference: https://go.dev/doc/go1.21#slices

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
Eng Zer Jun
2025-03-04 00:46:49 +11:00
committed by GitHub
parent 88f0131abb
commit 04c33968cf
52 changed files with 53 additions and 55 deletions
+1 -1
View File
@@ -14,6 +14,7 @@ import (
"os"
"os/user"
"path/filepath"
"slices"
"sort"
"strconv"
"strings"
@@ -26,7 +27,6 @@ import (
"github.com/prometheus/common/expfmt"
"github.com/spf13/afero"
"go.uber.org/atomic"
"golang.org/x/exp/slices"
"golang.org/x/sync/errgroup"
"golang.org/x/xerrors"
"google.golang.org/protobuf/types/known/timestamppb"
+1 -1
View File
@@ -19,6 +19,7 @@ import (
"path/filepath"
"regexp"
"runtime"
"slices"
"strconv"
"strings"
"sync/atomic"
@@ -41,7 +42,6 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"golang.org/x/crypto/ssh"
"golang.org/x/exp/slices"
"golang.org/x/xerrors"
"cdr.dev/slog"
+1 -1
View File
@@ -12,6 +12,7 @@ import (
"os/user"
"path/filepath"
"runtime"
"slices"
"strings"
"sync"
"time"
@@ -24,7 +25,6 @@ import (
"github.com/spf13/afero"
"go.uber.org/atomic"
gossh "golang.org/x/crypto/ssh"
"golang.org/x/exp/slices"
"golang.org/x/xerrors"
"cdr.dev/slog"
+1 -1
View File
@@ -3,6 +3,7 @@ package agenttest
import (
"context"
"io"
"slices"
"sync"
"sync/atomic"
"testing"
@@ -12,7 +13,6 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"golang.org/x/exp/maps"
"golang.org/x/exp/slices"
"golang.org/x/xerrors"
"google.golang.org/protobuf/types/known/durationpb"
"google.golang.org/protobuf/types/known/emptypb"
+1 -1
View File
@@ -5,11 +5,11 @@ import (
"errors"
"io"
"net"
"slices"
"time"
"github.com/armon/circbuf"
"github.com/prometheus/client_golang/prometheus"
"golang.org/x/exp/slices"
"golang.org/x/xerrors"
"cdr.dev/slog"