aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josh@tailscale.com>2020-12-04 16:05:51 -0800
committerJosh Bleecher Snyder <josh@tailscale.com>2020-12-08 14:25:10 -0800
commitc4895658e629ed9d5154c73eb5585c12fdba5b4b (patch)
treeeb19b838990a04e566dc5a497da16104fcd180b7
parentdevice: clear pointers when returning elems to pools (diff)
downloadwireguard-go-c4895658e629ed9d5154c73eb5585c12fdba5b4b.tar.xz
wireguard-go-c4895658e629ed9d5154c73eb5585c12fdba5b4b.zip
device: avoid copying lock in tests
This doesn't cause any practical problems as it is, but vet (rightly) flags this code as copying a mutex. It is easy to fix, so do so. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
-rw-r--r--device/peer_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/device/peer_test.go b/device/peer_test.go
index 6aa238b..9c1ede5 100644
--- a/device/peer_test.go
+++ b/device/peer_test.go
@@ -26,7 +26,7 @@ func checkAlignment(t *testing.T, name string, offset uintptr) {
func TestPeerAlignment(t *testing.T) {
var p Peer
- typ := reflect.TypeOf(p)
+ typ := reflect.TypeOf(&p).Elem()
t.Logf("Peer type size: %d, with fields:", typ.Size())
for i := 0; i < typ.NumField(); i++ {
field := typ.Field(i)