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:
parent
d3ff2d6b62
commit
c4895658e6
|
@ -26,7 +26,7 @@ func checkAlignment(t *testing.T, name string, offset uintptr) {
|
||||||
func TestPeerAlignment(t *testing.T) {
|
func TestPeerAlignment(t *testing.T) {
|
||||||
var p Peer
|
var p Peer
|
||||||
|
|
||||||
typ := reflect.TypeOf(p)
|
typ := reflect.TypeOf(&p).Elem()
|
||||||
t.Logf("Peer type size: %d, with fields:", typ.Size())
|
t.Logf("Peer type size: %d, with fields:", typ.Size())
|
||||||
for i := 0; i < typ.NumField(); i++ {
|
for i := 0; i < typ.NumField(); i++ {
|
||||||
field := typ.Field(i)
|
field := typ.Field(i)
|
||||||
|
|
Loading…
Reference in a new issue