Skip to content

Commit cf4f584

Browse files
authored
Switch to Go 1.23+ stdlib slices package (#2969)
Use the `slices` package from the Go standard library instead of the `golang.org/x/exp/slices` package which merely wraps the stdlib package for the functions used here.
1 parent db56027 commit cf4f584

File tree

6 files changed

+6
-7
lines changed

6 files changed

+6
-7
lines changed

core/clab.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"fmt"
1111
"io/fs"
1212
"os"
13+
"slices"
1314
"strings"
1415
"sync"
1516
"time"
@@ -28,7 +29,6 @@ import (
2829
clabtypes "github.com/srl-labs/containerlab/types"
2930
clabutils "github.com/srl-labs/containerlab/utils"
3031
"golang.org/x/crypto/ssh"
31-
"golang.org/x/exp/slices"
3232
)
3333

3434
var ErrNodeNotFound = errors.New("node not found")

core/clab_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ package core
77
import (
88
"context"
99
"errors"
10+
"slices"
1011
"testing"
1112

1213
"github.com/google/go-cmp/cmp"
@@ -18,7 +19,6 @@ import (
1819
_ "github.com/srl-labs/containerlab/runtime/all"
1920
clabtypes "github.com/srl-labs/containerlab/types"
2021
"go.uber.org/mock/gomock"
21-
"golang.org/x/exp/slices"
2222
)
2323

2424
// getNodeMap return a map of nodes for testing purpose.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ require (
4747
github.com/weaveworks/ignite v0.10.0
4848
go.uber.org/mock v0.5.0
4949
golang.org/x/crypto v0.43.0
50-
golang.org/x/exp v0.0.0-20250103183323-7d7fa50e5329
5150
golang.org/x/sys v0.37.0
5251
golang.org/x/term v0.36.0
5352
gopkg.in/yaml.v2 v2.4.0
@@ -155,6 +154,7 @@ require (
155154
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0 // indirect
156155
go.opentelemetry.io/otel/metric v1.31.0 // indirect
157156
go.yaml.in/yaml/v3 v3.0.4 // indirect
157+
golang.org/x/exp v0.0.0-20250103183323-7d7fa50e5329 // indirect
158158
google.golang.org/genproto/googleapis/rpc v0.0.0-20250102185135-69823020774d // indirect
159159
sigs.k8s.io/knftables v0.0.18 // indirect
160160
sigs.k8s.io/randfill v1.0.0 // indirect

internal/mermaid/graph.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ package mermaid
33
import (
44
"fmt"
55
"io"
6-
7-
"golang.org/x/exp/slices"
6+
"slices"
87
)
98

109
// A very minimalistic Mermaid flowchart generator

types/topology_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package types
22

33
import (
4+
"slices"
45
"testing"
56

67
"github.com/google/go-cmp/cmp"
78
clabutils "github.com/srl-labs/containerlab/utils"
8-
"golang.org/x/exp/slices"
99
)
1010

1111
var topologyTestSet = map[string]struct {

utils/resolve.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import (
44
"bufio"
55
"io/fs"
66
"net"
7+
"slices"
78
"strings"
89

910
"github.com/charmbracelet/log"
10-
"golang.org/x/exp/slices"
1111
)
1212

1313
// ExtractDNSServersFromResolvConf extracts IP addresses

0 commit comments

Comments
 (0)