mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-11 13:18:53 +00:00
all: use Go 1.20's bytes.Clone
Updates #7123 Updates #6257 (more to do in other repos) Change-Id: I073e2a6d81a5d7fbecc29caddb7e057ff65239d0 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
f7b3156f16
commit
cf8dd7aa09
@@ -126,7 +126,7 @@ func TestSendRecv(t *testing.T) {
|
||||
if m.Source.IsZero() {
|
||||
t.Errorf("zero Source address in ReceivedPacket")
|
||||
}
|
||||
recvChs[i] <- append([]byte(nil), m.Data...)
|
||||
recvChs[i] <- bytes.Clone(m.Data)
|
||||
}
|
||||
}
|
||||
}(i)
|
||||
|
@@ -4,6 +4,7 @@
|
||||
package derphttp
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"net"
|
||||
@@ -102,7 +103,7 @@ func TestSendRecv(t *testing.T) {
|
||||
case derp.PeerGoneMessage:
|
||||
// Ignore.
|
||||
case derp.ReceivedPacket:
|
||||
recvChs[i] <- append([]byte(nil), m.Data...)
|
||||
recvChs[i] <- bytes.Clone(m.Data)
|
||||
}
|
||||
}
|
||||
}(i)
|
||||
|
Reference in New Issue
Block a user