fix(handlers): nolint:unused waitAsyncForTest (golangci-lint v2 mc#1099)
audit-force-merge / audit (pull_request) Has been skipped

waitAsyncForTest blocks until all goroutines launched via goAsync have
completed. It is intended for use in *_test.go files to prevent
goroutine leaks, but is defined in the production package to avoid
import cycles across test files in this package.

golangci-lint v2.x 'unused' linter catches it in production code.
Suppress with //nolint:unused since the function is intentionally
defined-but-not-called in production — it exists for tests.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-15 13:27:06 +00:00
parent bb21d493a9
commit f578a4179b
@@ -85,6 +85,11 @@ func (h *WorkspaceHandler) goAsync(fn func()) {
}()
}
// waitAsyncForTest blocks until all goroutines launched via goAsync have
// completed. Intended for use in test files to prevent goroutine leaks;
// defined here (not in the test package) so it can be used across all
// *_test.go files in this package without import cycles.
//nolint:unused
func (h *WorkspaceHandler) waitAsyncForTest() {
h.asyncWG.Wait()
}