From: Josh Bleecher Snyder Date: Sat, 5 Dec 2020 00:05:51 +0000 (-0800) Subject: device: avoid copying lock in tests X-Git-Tag: 0.0.20210212~137 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4895658e629ed9d5154c73eb5585c12fdba5b4b;p=thirdparty%2Fwireguard-go.git 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 --- 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)