[PR #192] test: don't copy atomic.Uint32 when reporting TestWaitPool failure #196

Open
opened 2026-10-13 21:04:28 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/amnezia-vpn/amneziawg-go/pull/192
Author: @artromone
Created: 9/3/2026
Status: 🔄 Open

Base: master ← Head: fix/vet-copylocks-pools-test


📝 Commits (1)

  • b7f5b72 test: don't copy atomic.Uint32 when reporting TestWaitPool failure

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 device/pools_test.go (+1 -1)

📄 Description

TestWaitPool passed the atomic.Uint32 itself to t.Errorf instead of the value it had already loaded for the comparison. Formatting it copies the wrapper, and the embedded noCopy marker makes that invalid under the copylocks analyzer, so go vet ./device failed on an unmodified tree:

device/pools_test.go:67:69: call of t.Errorf copies lock value:
sync/atomic.Uint32 contains sync/atomic.noCopy

Format max.Load() instead. go vet ./... is now clean.

Fixes #157


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/amnezia-vpn/amneziawg-go/pull/192 **Author:** [@artromone](https://github.com/artromone) **Created:** 9/3/2026 **Status:** 🔄 Open **Base:** `master` ← **Head:** `fix/vet-copylocks-pools-test` --- ### 📝 Commits (1) - [`b7f5b72`](https://github.com/amnezia-vpn/amneziawg-go/commit/b7f5b72b393be00211718399a6c67c7a6694e653) test: don't copy atomic.Uint32 when reporting TestWaitPool failure ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `device/pools_test.go` (+1 -1) </details> ### 📄 Description TestWaitPool passed the atomic.Uint32 itself to t.Errorf instead of the value it had already loaded for the comparison. Formatting it copies the wrapper, and the embedded noCopy marker makes that invalid under the copylocks analyzer, so `go vet ./device` failed on an unmodified tree: device/pools_test.go:67:69: call of t.Errorf copies lock value: sync/atomic.Uint32 contains sync/atomic.noCopy Format max.Load() instead. `go vet ./...` is now clean. Fixes #157 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
amnezia-vpn/amneziawg-go#196
No description provided.