refactor(leak): replace init() guard with lazy sync.Once check by Copilot · Pull Request #82 · go-openapi/testify (original) (raw)
The compatibility guard for pprof goroutine profile label format now runs lazily via sync.Once on the first call to Leaked(), instead of eagerly in init(). This avoids overhead and potential panics for programs that import the assertions package but never use NoGoRoutineLeak.
Signed-off-by: GitHub Copilot copilot@github.com
Co-authored-by: fredbi 14262513+fredbi@users.noreply.github.com
Copilot AI changed the title[WIP] Analyze guard implementation options for undocumented Go API refactor(leak): replace init() guard with lazy sync.Once check
fredbi marked this pull request as ready for review
- Add //nolint:gochecknoglobals annotation with justification on compatOnce
- Replace wg.Add(1)/go func()/defer wg.Done() with wg.Go() (Go 1.25)
Signed-off-by: GitHub Copilot copilot@github.com
Co-authored-by: fredbi 14262513+fredbi@users.noreply.github.com
fredbi deleted the copilot/compare-guard-implementation-options branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})