change read packet data
Some checks failed
Build and Publish / BuildAndDeploy (push) Has been cancelled
Some checks failed
Build and Publish / BuildAndDeploy (push) Has been cancelled
This commit is contained in:
@@ -94,10 +94,7 @@ func ReadPacket[V Packet | CartPacket](conn io.Reader, packet *V) error {
|
|||||||
|
|
||||||
func GetPacketData(conn io.Reader, len int) ([]byte, error) {
|
func GetPacketData(conn io.Reader, len int) ([]byte, error) {
|
||||||
data := make([]byte, len)
|
data := make([]byte, len)
|
||||||
l, err := conn.Read(data)
|
_, err := conn.Read(data)
|
||||||
if l != len {
|
|
||||||
return nil, fmt.Errorf("expected %d bytes, got %d", len, l)
|
|
||||||
}
|
|
||||||
return data, err
|
return data, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user