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>
This commit is contained in:
Josh Bleecher Snyder 2020-12-04 16:05:51 -08:00
parent d3ff2d6b62
commit c4895658e6

View file

@ -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)