From c4895658e629ed9d5154c73eb5585c12fdba5b4b Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Fri, 4 Dec 2020 16:05:51 -0800 Subject: 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 --- device/peer_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- cgit v1.2.3-59-g8ed1b