Affected version
github.com/amnezia-vpn/amneziawg-go v1.0.4
- Go
1.26.4
- Linux amd64
Minimal reproduction
From an unmodified v1.0.4 checkout:
Observed behavior
device/pools_test.go:65:69: call of t.Errorf copies lock value: sync/atomic.Uint32 contains sync/atomic.noCopy
TestWaitPool passes the atomic.Uint32 value itself to t.Errorf:
t.Errorf("Actual maximum count (%d) != ideal maximum count (%d)", max, p.max)
Formatting the value copies the atomic wrapper, whose embedded noCopy marker makes that operation invalid under the copylocks analyzer.
Expected behavior
go vet ./device should pass. The diagnostic should format the already-observed scalar instead:
t.Errorf("Actual maximum count (%d) != ideal maximum count (%d)", max.Load(), p.max)
Affected version
github.com/amnezia-vpn/amneziawg-go v1.0.41.26.4Minimal reproduction
From an unmodified v1.0.4 checkout:
Observed behavior
TestWaitPoolpasses theatomic.Uint32value itself tot.Errorf:Formatting the value copies the atomic wrapper, whose embedded
noCopymarker makes that operation invalid under thecopylocksanalyzer.Expected behavior
go vet ./deviceshould pass. The diagnostic should format the already-observed scalar instead: