Cleanup / temp buffers for various things
This commit is contained in:
@@ -59,7 +59,8 @@ func TestRoundTrip(t *testing.T) {
|
||||
|
||||
for _, tc := range cases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
buf := tc.ping.Marshal()
|
||||
var buf [control.Size]byte
|
||||
tc.ping.Marshal(buf[:])
|
||||
got, err := control.Unmarshal(buf)
|
||||
if err != nil {
|
||||
t.Fatalf("Unmarshal: %v", err)
|
||||
@@ -80,7 +81,8 @@ func TestUnmarshalBadVersion(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestZeroEncoding(t *testing.T) {
|
||||
buf := (control.Ping{}).Marshal()
|
||||
var buf [control.Size]byte
|
||||
(control.Ping{}).Marshal(buf[:])
|
||||
for i, b := range buf {
|
||||
if i == 0 {
|
||||
continue // version byte
|
||||
|
||||
Reference in New Issue
Block a user