Skip to content

Commit 9caf48f

Browse files
committed
tcpstat: use std lib binary.NativeEndian
Use standard lib binary.NativeEndian instead of third-party package. Supported since Go 1.21. Signed-off-by: Daniel Swarbrick <[email protected]>
1 parent be19d53 commit 9caf48f

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

collector/tcpstat_linux_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,13 @@ import (
2222
"syscall"
2323
"testing"
2424

25-
"github.com/josharian/native"
2625
"github.com/mdlayher/netlink"
2726
)
2827

2928
func Test_parseTCPStats(t *testing.T) {
3029
encode := func(m InetDiagMsg) []byte {
3130
var buf bytes.Buffer
32-
err := binary.Write(&buf, native.Endian, m)
31+
err := binary.Write(&buf, binary.NativeEndian, m)
3332
if err != nil {
3433
panic(err)
3534
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ require (
1212
github.com/hashicorp/go-envparse v0.1.0
1313
github.com/hodgesds/perf-utils v0.7.0
1414
github.com/illumos/go-kstat v0.0.0-20210513183136-173c9b0a9973
15-
github.com/josharian/native v1.1.0
1615
github.com/jsimonetti/rtnetlink/v2 v2.0.5
1716
github.com/lufia/iostat v1.2.1
1817
github.com/mattn/go-xmlrpc v0.0.3
@@ -39,6 +38,7 @@ require (
3938
github.com/cespare/xxhash/v2 v2.3.0 // indirect
4039
github.com/dennwc/ioctl v1.0.0 // indirect
4140
github.com/google/go-cmp v0.7.0 // indirect
41+
github.com/josharian/native v1.1.0 // indirect
4242
github.com/jpillora/backoff v1.0.0 // indirect
4343
github.com/kylelemons/godebug v1.1.0 // indirect
4444
github.com/mdlayher/genetlink v1.3.2 // indirect

0 commit comments

Comments
 (0)