Skip to content

Commit 9dad378

Browse files
committed
fix indent char
1 parent e6f09c6 commit 9dad378

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

actually_ctx.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,36 +13,36 @@ var aCtx = &aContext{
1313
}
1414

1515
type aContext struct {
16-
mu sync.RWMutex
17-
failNowStates map[int64]bool // [goroutineID]bool
16+
mu sync.RWMutex
17+
failNowStates map[int64]bool // [goroutineID]bool
1818
}
1919

2020
func (ac *aContext) failNowOn() {
21-
ac.mu.Lock()
22-
defer ac.mu.Unlock()
23-
ac.failNowStates[goroutineID()] = true
21+
ac.mu.Lock()
22+
defer ac.mu.Unlock()
23+
ac.failNowStates[goroutineID()] = true
2424
}
2525

2626
func (ac *aContext) failNotNow() {
27-
ac.mu.Lock()
28-
defer ac.mu.Unlock()
29-
delete(ac.failNowStates, goroutineID())
27+
ac.mu.Lock()
28+
defer ac.mu.Unlock()
29+
delete(ac.failNowStates, goroutineID())
3030
}
3131

3232
func (ac *aContext) failNowState() bool {
33-
ac.mu.RLock()
34-
defer ac.mu.RUnlock()
35-
return ac.failNowStates[goroutineID()]
33+
ac.mu.RLock()
34+
defer ac.mu.RUnlock()
35+
return ac.failNowStates[goroutineID()]
3636
}
3737

3838
func goroutineID() int64 {
39-
var buf [64]byte
40-
n := runtime.Stack(buf[:], false)
41-
idField := strings.Fields(strings.TrimPrefix(string(buf[:n]), "goroutine "))[0]
42-
id, err := strconv.ParseInt(idField, 10, 64)
39+
var buf [64]byte
40+
n := runtime.Stack(buf[:], false)
41+
idField := strings.Fields(strings.TrimPrefix(string(buf[:n]), "goroutine "))[0]
42+
id, err := strconv.ParseInt(idField, 10, 64)
4343
if err != nil {
4444
panic(err)
4545
}
4646

47-
return id
47+
return id
4848
}

helpers.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ func (a *testingA) FailNow() *testingA {
3636
})
3737
*/
3838
func FailNow(fn func()) {
39-
aCtx.failNowOn()
40-
defer aCtx.failNotNow()
41-
fn()
39+
aCtx.failNowOn()
40+
defer aCtx.failNotNow()
41+
fn()
4242
}
4343

4444
// X turns on a flag to show test values as raw in a fail report.

0 commit comments

Comments
 (0)