feat: optimize code

This commit is contained in:
fengcaiwen
2023-03-16 19:11:22 +08:00
committed by wencaiwulue
parent a545f3a958
commit 1970f30f9d
13 changed files with 173 additions and 144 deletions

View File

@@ -3,6 +3,7 @@ package util
import (
"encoding/json"
"net"
"strings"
"testing"
"github.com/containernetworking/cni/libcni"
@@ -94,6 +95,9 @@ func TestPing(t *testing.T) {
}
ipConn, err := net.ListenPacket("ip4:icmp", "0.0.0.0")
if err != nil {
if strings.Contains(err.Error(), "operation not permitted") {
return
}
t.Error(err)
}
bytes := buf.Bytes()