Skip to content

Commit e8bdb76

Browse files
committed
use slices and maps packages instead of x/exp
Signed-off-by: Lorenz Bauer <[email protected]>
1 parent 034238a commit e8bdb76

File tree

11 files changed

+12
-19
lines changed

11 files changed

+12
-19
lines changed

btf/core_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"errors"
55
"fmt"
66
"os"
7+
"slices"
78
"strings"
89
"testing"
910

@@ -13,7 +14,6 @@ import (
1314
"github.com/cilium/ebpf/internal/testutils"
1415

1516
"github.com/go-quicktest/qt"
16-
"golang.org/x/exp/slices"
1717
)
1818

1919
func TestCheckTypeCompatibility(t *testing.T) {

btf/marshal.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ import (
66
"errors"
77
"fmt"
88
"math"
9+
"slices"
910
"sync"
1011

1112
"github.com/cilium/ebpf/internal"
12-
13-
"golang.org/x/exp/slices"
1413
)
1514

1615
type MarshalOptions struct {

btf/strings.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ import (
66
"errors"
77
"fmt"
88
"io"
9+
"maps"
10+
"slices"
911
"strings"
10-
11-
"golang.org/x/exp/maps"
12-
"golang.org/x/exp/slices"
1312
)
1413

1514
type stringTable struct {

btf/types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import (
66
"fmt"
77
"io"
88
"math"
9+
"slices"
910
"strings"
1011

1112
"github.com/cilium/ebpf/asm"
1213
"github.com/cilium/ebpf/internal"
1314
"github.com/cilium/ebpf/internal/sys"
14-
"golang.org/x/exp/slices"
1515
)
1616

1717
// Mirrors MAX_RESOLVE_DEPTH in libbpf.

cmd/bpf2go/main.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@ import (
1313
"path/filepath"
1414
"regexp"
1515
"runtime"
16+
"slices"
1617
"sort"
1718
"strings"
1819

19-
"golang.org/x/exp/slices"
20-
2120
"github.com/cilium/ebpf"
2221
)
2322

cmd/bpf2go/main_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import (
99
"os/exec"
1010
"path/filepath"
1111
"runtime"
12+
"slices"
1213
"strings"
1314
"testing"
1415

1516
"github.com/go-quicktest/qt"
1617
"github.com/google/go-cmp/cmp"
17-
"golang.org/x/exp/slices"
1818
)
1919

2020
func TestRun(t *testing.T) {

internal/cmd/gentypes/main.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@ import (
99
"errors"
1010
"fmt"
1111
"os"
12+
"slices"
1213
"sort"
1314
"strings"
1415

1516
"github.com/cilium/ebpf/btf"
1617
"github.com/cilium/ebpf/internal"
1718
"github.com/cilium/ebpf/internal/sys"
18-
19-
"golang.org/x/exp/slices"
2019
)
2120

2221
type syscallRetval int

internal/sysenc/marshal.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ import (
77
"errors"
88
"fmt"
99
"reflect"
10+
"slices"
1011
"sync"
1112
"unsafe"
1213

1314
"github.com/cilium/ebpf/internal"
14-
15-
"golang.org/x/exp/slices"
1615
)
1716

1817
// Marshal turns data into a byte slice using the system's native endianness.

link/query_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ package link
22

33
import (
44
"os"
5+
"slices"
56
"testing"
67

78
"github.com/cilium/ebpf"
89
"github.com/cilium/ebpf/internal/testutils"
910

1011
"github.com/go-quicktest/qt"
11-
"golang.org/x/exp/slices"
1212
)
1313

1414
func TestQueryPrograms(t *testing.T) {

linker.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import (
66
"fmt"
77
"io"
88
"math"
9-
10-
"golang.org/x/exp/slices"
9+
"slices"
1110

1211
"github.com/cilium/ebpf/asm"
1312
"github.com/cilium/ebpf/btf"

marshalers.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ import (
55
"errors"
66
"fmt"
77
"reflect"
8+
"slices"
89
"unsafe"
910

1011
"github.com/cilium/ebpf/internal"
1112
"github.com/cilium/ebpf/internal/sys"
1213
"github.com/cilium/ebpf/internal/sysenc"
13-
14-
"golang.org/x/exp/slices"
1514
)
1615

1716
// marshalMapSyscallInput converts an arbitrary value into a pointer suitable

0 commit comments

Comments
 (0)