1
0
mirror of https://git.zx2c4.com/wireguard-go synced 2024-11-15 01:05:15 +01:00

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