ax(mining): rename wg to waitGroup in circuit breaker concurrency test

AX Principle 1: predictable names over short names. wg requires
mental mapping to WaitGroup; waitGroup is self-documenting.

Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
Claude 2026-04-02 13:27:05 +01:00
parent 96a450eff5
commit db80ce6dde
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -302,11 +302,11 @@ func TestCircuitBreaker_Reset_Good(t *testing.T) {
func TestCircuitBreaker_Concurrency_Ugly(t *testing.T) {
cb := NewCircuitBreaker("test", DefaultCircuitBreakerConfig())
var wg sync.WaitGroup
var waitGroup sync.WaitGroup
for i := 0; i < 100; i++ {
wg.Add(1)
waitGroup.Add(1)
go func(n int) {
defer wg.Done()
defer waitGroup.Done()
cb.Execute(func() (interface{}, error) { //nolint:errcheck
if n%3 == 0 {
return nil, errors.New("fail")
@ -315,7 +315,7 @@ func TestCircuitBreaker_Concurrency_Ugly(t *testing.T) {
})
}(i)
}
wg.Wait()
waitGroup.Wait()
_ = cb.State()
}