refactor(leak): replace init() guard with lazy sync.Once check by Copilot · Pull Request #82 · go-openapi/testify (original) (raw)

@fredbi

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

Mar 19, 2026

@fredbi fredbi marked this pull request as ready for review

March 19, 2026 18:11

fredbi

@fredbi

Signed-off-by: GitHub Copilot copilot@github.com

Co-authored-by: fredbi 14262513+fredbi@users.noreply.github.com

@fredbi fredbi deleted the copilot/compare-guard-implementation-options branch

March 19, 2026 19:22

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