From 8d2eb1b48e8f6fd4ca7d406cd42f4e560517fee5 Mon Sep 17 00:00:00 2001 From: cuisongliu Date: Thu, 27 Jan 2022 11:38:48 +0800 Subject: [PATCH] feature(main): add udp string to []uint8 --- api/network/v1beta1/types.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/network/v1beta1/types.go b/api/network/v1beta1/types.go index 7e55306..b320831 100644 --- a/api/network/v1beta1/types.go +++ b/api/network/v1beta1/types.go @@ -74,13 +74,13 @@ type UDPSocketAction struct { Enable bool `json:"enable" protobuf:"bytes,1,opt,name=enable"` // UDP test data // +optional - Data []int8 `json:"data,omitempty" protobuf:"bytes,2,rep,name=data"` + Data []uint8 `json:"data,omitempty" protobuf:"varint,2,rep,name=data"` } -func Int8ArrToByteArr(data []int8) []byte { +func Int8ArrToByteArr(data []uint8) []byte { r := make([]byte, len(data)) for i, d := range data { - r[i] = byte(d) + r[i] = d } return r }